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.Row 속성 을 설정하기 전에 먼저 Grid의 행을 정의해야합니다.
<Grid>
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Button Grid.Row="1" Content="Click Me!" />
</Grid>
RowDefinitions 의 Height 속성 을 변경 하면 Button을 세로로 쉽게 배치 할 수 있습니다 .
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="90*"></RowDefinition>
<RowDefinition Height="10*"></RowDefinition>
</Grid.RowDefinitions>
<Button Grid.Row="1" Content="Click Me!" />
</Grid>
10 *은 그리드의 10 %를 의미합니다. 별의 합은 100이어야합니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다