2015-09-16 31 views
2

在我的ContentDialog中。在关注任何元素时,输入TextBox,键盘出现。当键盘出现时,有一个大的余量上面(所以20-30像素也许)。该空间与分配给主要和次要按钮的空间高度相同。如果有这个边距,我的内容有一个滚动条,我不想要它。我有足够的空间显示我的对话框的所有内容,如果删除这个边际/填充当然。 ContentDialog Windows 10 Mobile XAML - FullScreen - Padding删除保证金按钮ContentDialog Windows 10 Mobile - XAML

<StackPanel Orientation="Horizontal"> 


      <TextBox x:Name="txtUser" IsSpellCheckEnabled="False" 
      Background="Black" Foreground="Red BorderBrush="Red" BorderThickness="1" 
      PlaceholderText="Digit your username" 
      GotFocus="txtUser_GotFocus" Style="{StaticResource TextBoxStyle}" 
      TextChanged="txtUser_TextChanged" 
      /> 

      <Button x:Name="MakeOff" 
      Height="32" BorderThickness="1" 
      HorizontalAlignment="Center" 
      Foreground="Red" Background="Black" 
      Style="{StaticResource ButtonStyle}" 
      Margin="0"> 

      <HyperlinkButton 
      Height="32" BorderThickness="1" 
      HorizontalAlignment="Center" 
      Foreground="Red" Background="Black" 
      Margin="0" 
      NavigateUri="www.google.pt" 
      Style="{StaticResource HyperLinkButtonStyleMobile}" 
      Content="Register"> 
       <HyperlinkButton.ContentTemplate> 
        <DataTemplate> 
        <TextBlock Text="{Binding}" /> 
        </DataTemplate> 
       </HyperlinkButton.ContentTemplate> 
      </HyperlinkButton> 

      <Button 
      Height="32" BorderThickness="1" 
      HorizontalAlignment="Center" 
      Foreground="Red" Background="Black" 
      Style="{StaticResource ButtonStyle}" 
      Margin="0"> 

      <HyperlinkButton x:Name="btnRegisterTwo" 
      Height="32" BorderThickness="1" 
      HorizontalAlignment="Center" 
      Foreground="Red" Background="Black" 
      Margin="0" 
      NavigateUri="www.google.pt" 
      Style="{StaticResource HyperLinkButtonStyleMobile}" 
      Content="Register"> 
       <HyperlinkButton.ContentTemplate> 
        <DataTemplate> 
        <TextBlock Text="{Binding}" /> 
        </DataTemplate> 
       </HyperlinkButton.ContentTemplate> 
      </HyperlinkButton> 

      <Button x:Name="MakeOffThree" 
      Height="32" BorderThickness="1" 
      HorizontalAlignment="Center" 
      Foreground="Red" Background="Black" 
      Style="{StaticResource ButtonStyle}" 
      Margin="0"> 
      </StackPanel> 
     </Grid> 

有人有助于消除这样的:

此主题与有关?

感谢

+0

您还可以添加文本框和按钮的代码吗? –

+0

贾斯汀XL,检查它! – fipcurren88

+0

文本框在哪里? –

回答

1

有趣的是,ContentScrollViewer风格内给予在运行时一个固定的高度,一个黑客是从ScrollViewer删除此x:Name

<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Disabled" ZoomMode="Disabled" Margin="{ThemeResource ContentDialogContentScrollViewerMargin}" IsTabStop="False"> 

此外,您将需要添加RowDefinitions回根面板LayoutRoot的风格。

<Grid x:Name="LayoutRoot"> 
    <Grid.RowDefinitions> 
     <RowDefinition Height="Auto" /> 
    </Grid.RowDefinitions> 
+1

太好了。工作。 非常感谢。 – fipcurren88

+0

只有一个问题。当横向模式被激活时,弹出消失。之前,手机呆在人像模式下(在我的lumia中) – fipcurren88

+0

对话框消失或仅出现对话框的一部分。 – fipcurren88