android - 在 xamarin 表单设计方面需要帮助
<p><p>我正在使用具有 android 和 IOS 项目的可移植 xamarin 表单(跨平台)制作应用程序。</p>
<p>我遇到了设计问题。</p>
<p>下面是我的代码。 </p>
<pre><code><Grid ColumnSpacing="0" RowSpacing="0" >
<Grid.RowDefinitions >
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<StackLayout Grid.Row="0" Grid.Column="0" Padding="20,30,20,0">
<StackLayout VerticalOptions="StartAndExpand" HorizontalOptions="FillAndExpand" HeightRequest="30" BackgroundColor="#6E335E" Padding="10,0,10,0" >
<Label Text="{ Binding CompanyName }" FontSize="18"HorizontalOptions="Start" VerticalOptions="CenterAndExpand"HorizontalTextAlignment="Center" TextColor="White" ></Label>
</StackLayout>
</StackLayout>
<StackLayout VerticalOptions="FillAndExpand" Grid.Row="1" HeightRequest="130"HorizontalOptions="FillAndExpand" Padding="20,0,20,0">
<ImageSource="{ Binding LogoPath }" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" Aspect="AspectFill"></Image>
</StackLayout>
<StackLayout Grid.Row="2" Grid.Column="0" Padding="10,0,10,30" VerticalOptions="StartAndExpand" HorizontalOptions="FillAndExpand" >
<ImageSource="image_bottom.png" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" Aspect="AspectFill"></Image>
</StackLayout>
</Grid>
</code></pre>
<p>下面是描述我想要设计的图片</p>
<p> <a href="/image/pmpHf.png" rel="noreferrer noopener nofollow"><img src="/image/pmpHf.png" alt="enter image description here"/></a> </p>
<p>请帮我设计问题。</p>
<p>提前感谢</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>您的 stacklayout 的高度为 130,因此行定义仅扩展到该点。您应该将定义设置为 *,并将网格垂直选项设置为 fillandexpand,以便填充剩余的空间。 </p>
<pre><code><Grid.RowDefinitions >
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
</Grid.RowDefinitions>
</code></pre></p>
<p style="font-size: 20px;">关于android - 在 xamarin 表单设计方面需要帮助,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/40146968/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/40146968/
</a>
</p>
页:
[1]