0

windows phone keypad我在中遇到了一个相当不寻常的效果portrait mode。我有一个textboxat bottom of my grid,下面是app bar。现在当文本框获得焦点时,textbox and the keypad. 我已经在这张照片中指出了

在此处输入图像描述.

这也是我的代码,

   <Grid x:Name="LayoutRoot" Background="Green">
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>
    <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
        <TextBlock Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}" Margin="12,0"/>
        <TextBlock Text="page name" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
    </StackPanel>

    <!--ContentPanel - place additional content here-->
    <Grid Background="PeachPuff" x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*" MaxHeight="100"/>
        </Grid.RowDefinitions>
        <ScrollViewer x:Name="scrollthis">
            <StackPanel x:Name="mystack"/>
        </ScrollViewer>
        <TextBox InputScope="Search" Grid.Row="1" x:Name="myTextBox"/>
    </Grid>

    <!--Uncomment to see an alignment grid to help ensure your controls are
        aligned on common boundaries.  The image has a top margin of -32px to
        account for the System Tray. Set this to 0 (or remove the margin altogether)
        if the System Tray is hidden.

        Before shipping remove this XAML and the image itself.-->
    <!--<Image Source="/Assets/AlignmentGrid.png" VerticalAlignment="Top" Height="800" Width="480" Margin="0,-32,0,0" Grid.Row="0" Grid.RowSpan="2" IsHitTestVisible="False" />-->
</Grid>
<phone:PhoneApplicationPage.ApplicationBar>
    <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
        <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="enter text" Click="ApplicationBarIconButton_Click_1"/>
    </shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>

在应用栏上单击我执行以下操作。

    private void ApplicationBarIconButton_Click_1(object sender, EventArgs e)
    {
        TextBlock text = new TextBlock() { Text = myTextBox.Text, Margin = new Thickness(0,0,0,5) };
        myTextBox.Text = "";
        mystack.Children.Add(text);
    }

如果这是一个操作系统错误,我应该寻找黑客吗?Also please note that this spacing is not there in the landscape mode.

更新

app bar我刚刚发现只有在纵向模式的底部有一个时才会发生这种情况。

更新

我还注意到一件事,最初即使我处理了网格边距,在输入一些文本后,间距开始增长。

4

2 回答 2

0

这是在 GDR 3 更新中修复的错误。

于 2014-04-04T09:55:55.707 回答
0

为了解决这个问题,使您的应用栏具有不透明度(0.99 可以工作)并将 ContentPanel 的底部边距设置为 72(应用栏高度)。

于 2013-05-22T07:53:44.913 回答