我在windows phone keypad
portrait mode
中发现了一种相当不同寻常的效果。我在textbox
处有一个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
更新
我发现只有在肖像模式底部有{{1}}时才会发生。
更新
我还注意到了另外一件事,最初即使我处理网格边距,在输入一些文字后,间距也开始增长。
答案 0 :(得分:0)
要解决此问题,请使您的appbar具有不透明度(0.99将起作用),并将ContentPanel的下边距设置为72(应用栏高度)。
答案 1 :(得分:0)
这是一个在GDR 3更新中修复的错误。