Tilting web browser on windows phone 7
i'm working on a windows phone 7 emulator. I have a web browser which navigates to local host. So my problem i faced was that when i tilt the windows phone 7 emulator 90% right, the screen doesn't. Could there be any advice on how to do so?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
namespace DSP
{
public partial class MainPage : PhoneApplicationPage
{
// Constructor
public MainPage()
{
InitializeComponent();
}
private void ContentPanel_Loaded(object sender, Rout开发者_StackOverflow社区edEventArgs e)
{
MessageBox.Show("Loading website. This might take a few seconds...");
webBrowser1.Navigate(new Uri("http://localhost/Liweiyi_fyp_082648y/homepage.html", UriKind.Absolute));
}
private void webBrowser1_Loaded(object sender, RoutedEventArgs e)
{
}
}
}
Check your SupportedOrientations is PortraitOrLandscape in your xaml.
Also check your emulator isn't orientation locked due to hardware keybaord emulation. Restart it if you're not sure how to fix that.
I believe you're looking for how to handle orientation changes on the phone?
You're looking to change the following in the .xaml for the appropriate page - most likely MainPage.xaml:
Change the highlighted line to read
SupportedOrientations="PortraitOrLandscape"
And in case that wasn't enough information, here's a helpful blogpost.
精彩评论