でかなり変わった効果に出くわし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);
}
これが OS のバグである場合、ハックを探す必要がありますか?Also please note that this spacing is not there in the landscape mode.
アップデート
app bar
ポートレートモードで下部にがある場合にのみ発生することがわかりました。
アップデート
また、最初はグリッドの余白を処理しても、テキストを入力した後、間隔が広がり始めることに気付きました。