我在XAML:
<Grid.RowDefinitions>
<RowDefinition Height="8*" />
<RowDefinition Height="83*" />
<RowDefinition Height="8*" />
<RowDefinition Height="1*" />
</Grid.RowDefinitions>
<Grid Grid.Row="3" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" BackgroundColor="#EEEEEE" RowSpacing="0" Padding="0">
<Grid x:Name="a">
<local:TimerView x:Name="timerView1" VerticalOptions="FillAndExpand">
<local:TimerView.ProgressBar>
<Frame HasShadow="false" Padding="0" Margin="0" BackgroundColor="#AAAAAA" CornerRadius="0" VerticalOptions="FillAndExpand" />
</local:TimerView.ProgressBar>
<local:TimerView.TrackBar>
<Frame HasShadow="false" Padding="0" Margin="0" CornerRadius="0" BackgroundColor="#EEEEEE" VerticalOptions="FillAndExpand" />
</local:TimerView.TrackBar>
</local:TimerView>
</Grid>
</Grid>
我想要Grid.Row =&#34; 3&#34;要非常小,也许2-3 px。有没有办法可以将高度限制在这么小的数量?
答案 0 :(得分:2)
<Grid.RowDefinitions>
<RowDefinition Height="8*" />
<RowDefinition Height="83*" />
<RowDefinition Height="8*" />
<RowDefinition Height="3" /> // ---> The number 3 row (don't put any *)
</Grid.RowDefinitions>
...
当你把&#34; 3&#34;左右(没有*),值在DPI中。
请注意,如果您不使用&#34;要显示任何内容的行,您可以使用网格上的margin属性。即:
<Grid Margin="0,0,0,3"> // --> Sets a 3DPI margin at bottom
<Grid.RowDefinitions>
<RowDefinition Height="8*" />
<RowDefinition Height="83*" />
<RowDefinition Height="8*" />
</Grid.RowDefinitions>
...