2015-09-16 30 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