0
我已经设置了一个Windows Phone 8.1
项目,现在我正试图在水平靠近布局底部的位置放置一个按钮。如何使用网格行和列定义来定位按钮?
到目前为止,我已经想通了以下居中布局上的按钮,但 Grid.Row
设置似乎并没有对垂直定位产生任何影响,因为我的预期。
有谁知道我可以如何将按钮放置在屏幕的底部?目前它在屏幕中央,但在屏幕上方一半处需要朝向屏幕底部。
<Page x:Class="LC_Points.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:LC_Points"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
DataContext="{Binding Source={StaticResource Locator},
Path=MainViewModel}"
mc:Ignorable="d">
<Grid>
<Button Grid.Row="2"
Content="Calculate"
HorizontalAlignment="Center"/>
</Grid>
</Page>
谢谢,那么如何使用网格定义水平定位?此时按钮左对齐,需要水平居中。 –
同样,你应该定义列。拆分网格三个相等的列(没有宽度属性),并将按钮的grid.column属性设置为1. –
好吧,我试过了。 http://hastebin.com/uyidilimog.xml但按钮现在是右下角。你能展示一个代表你的意思的例子吗? –