I’m facing issues in rotating the Webview control in Windows 8 metro Apps using RotateTransform on click of a button.
RotateTransform rt = new RotateTransform();
rt.CenterX = webView.Width / 2;
rt.CenterY = webView.Height / 2;
rt.Angle = 90;
webView.RenderTransform = rt;
As you can check, I’m rotating Webview to 90 degrees, but Webview is not rotating.
please refer:
http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/d25bb7bd-d7ac-4e15-a4ee-882bf21464da
Any help/solution/reason will be helpful for me?
WebViews are special and cannot be rotated in a XAML application. It’s due to the fact that a WebView is an instance of Internet Explorer, which is an ActiveX component (likely still hosted that way) that cannot be rotated in the same way as XAML content. WebViews always are aligned to the rotation of the device. For what it’s worth, WPF has a similar design limitation.
Depending on what you’re trying to accomplish, an HTML based Win8 application might be a better choice as you can rotate HTML content using CSS3 transforms. Or, you might be able to rotate content inside of the browser in a XAML application as long as you didn’t need anything but right angles (0, 90, 180, 270).