2011-11-03 3 views
0

첫 번째 간단한 Windows Phone 앱을 구축하고 있습니다. 그래도 문제가 있습니다.Windows Phone WebBrowser 컨트롤이 회전하지 않고 높이가 100 %가 아닙니다.

WebBrowser 컨트롤을 사용하여 제어 할 수없는 웹 페이지를 표시하고 있습니다. 어떤 이유로 컨트롤이 전화기와 함께 회전하지 않습니다. 나는 왜 그랬는지 완전히 상실했다.

휴대 전화의 높이가 100 %가되지 않습니다. 자동으로 설정하면 0으로 실행됩니다.

아무도 도와 줄 수 있습니까?

답변

2

다음은 WebBrowser 컨트롤 만 포함하는 매우 간단한 응용 프로그램의 XAML입니다. 전체 크기이며 회전합니다. 앱과 비교하여 다른 점을 찾아 낼 수 있습니까? BTW, 요소에서 변경된 유일한 특성은 @SupportedOrientations의 가치입니다.

<phone:PhoneApplicationPage 
    x:Class="WP7WebBrowser.MainPage" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone" 
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768" 
    FontFamily="{StaticResource PhoneFontFamilyNormal}" 
    FontSize="{StaticResource PhoneFontSizeNormal}" 
    Foreground="{StaticResource PhoneForegroundBrush}" 
    SupportedOrientations="PortraitOrLandscape" Orientation="Portrait" 
    shell:SystemTray.IsVisible="True"> 

    <Grid x:Name="LayoutRoot" Background="Transparent"> 
     <phone:WebBrowser Source="http://www.bing.com" 
         HorizontalAlignment="Stretch" 
         VerticalAlignment="Stretch" /> 
    </Grid> 

</phone:PhoneApplicationPage> 

희망은 올바른 길을!

+0

감사합니다. 내가 생각하는 VerticalAlignment를 설정하는 것을 잊어 버렸습니다. 행 또는 그와 비슷한 것 또는 그와 비슷한 것. – JacobTheDev

+0

Windows Phone 8에서는 작동하지 않습니다. WebBrowser는 VerticalAlignment = "Stretch"인 경우에도 높이가 0입니다. – JustAMartin

관련 문제