gpt4 book ai didi

c# - 删除边距按钮 ContentDialog Windows 10 Mobile - XAML

转载 作者:太空宇宙 更新时间:2023-11-03 12:59:59 25 4
gpt4 key购买 nike

在我的 ContentDialog 中。聚焦任何元素,键入 TextBox,键盘出现。当键盘出现时,上面有很大的边距(可能是 20-30 像素)。该空间与分配给主按钮和辅助按钮的空间高度相同。如果有这个边距,我的内容有一个滚动条,我不想要它。如果当然删除此边距/填充,我有足够的空间来显示对话框的所有内容。

本主题与:ContentDialog Windows 10 Mobile XAML - FullScreen - Padding 相关

<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>

有人帮忙删除这个吗?

谢谢

最佳答案

有趣的是,样式中的 ContentScrollViewer 在运行时被赋予一个固定的高度,一个 hack 是从 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>

关于c# - 删除边距按钮 ContentDialog Windows 10 Mobile - XAML,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32615093/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com