【发布时间】:2016-02-23 13:57:32
【问题描述】:
我正在尝试了解自适应 UI。我经常使用引导程序,但正在使用xaml 设计 Windows 10 应用程序。我希望 textboxes 和 textbloxks 根据用户是否缩小窗口进行调整。这是我所拥有的,但它不是adapting,也不是响应式的。
<Grid Grid.Row="1">
<TextBlock HorizontalAlignment="Left" FontSize="24" Margin="10,22,0,0" Grid.Row="1" TextWrapping="Wrap" Text="Title" VerticalAlignment="Top"/>
<TextBox x:Name="txtBoxTitle" Margin="79,24,0,0" Grid.Row="1" Width="800" TextWrapping="Wrap" VerticalAlignment="Top" HorizontalAlignment="Left"/>
<TextBlock HorizontalAlignment="Left" FontSize="24" Margin="10,131,0,0" Grid.Row="1" TextWrapping="Wrap" Text="Body" VerticalAlignment="Top"/>
<TextBox x:Name="txtBoxBody" Margin="79,133,-225,0" Grid.Row="1" Width="800" Height="500" TextWrapping="Wrap" AcceptsReturn="True" HorizontalAlignment="Left" VerticalAlignment="Top"/>
<Button x:Name="btnSubmitArticle" Content="Submit" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="80,20,20,20" d:LayoutOverrides="Width"/>
</Grid>
其他问题
如何将文本框中的文本一直拉到窗口右侧,并使其在屏幕尺寸发生变化时正确响应。
<RelativePanel Margin="12,12">
<TextBlock x:Name="txtBoxDate"
RelativePanel.AlignLeftWithPanel="True"
RelativePanel.AlignRightWithPanel="True"
FontSize="14"
TextAlignment="Right"
TextWrapping="Wrap"
Text="Title" />
</RelativePanel>
谁能指出我正确的方向,根据屏幕尺寸使这些元素具有响应性?
【问题讨论】:
标签: xaml windows-10 uwp adaptive-ui