【发布时间】:2026-01-05 08:00:01
【问题描述】:
我有设计一页,但它看起来不像要求。我是 Xamarin 的新手,我不知道如何设计像 Attached image.
我的代码是
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
<RowDefinition Height="*"/>
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
<Label Text="From" Font="20" Grid.Row="0" Grid.Column="0"></Label>
<Entry x:Name="txtFrom" HorizontalOptions="FillAndExpand" Grid.Row="0" Grid.Column="1" ></Entry>
<Label Text="To" Font="20" Grid.Row="1" Grid.Column="0"></Label>
<Entry x:Name="txtTo" Grid.Row="1" Grid.Column="1" HorizontalOptions="FillAndExpand"></Entry>
<Label Text="Subject" Font="20" Grid.Column="0" Grid.Row="2"></Label>
<Entry x:Name="txtSubject" HorizontalOptions="FillAndExpand" Grid.Column="1" Grid.Row="2"></Entry>
<Label Text="Body" Font="20" Grid.Column="0" Grid.Row="3"></Label>
<Editor x:Name="txtBody" HeightRequest="100" Grid.Row="4" Grid.ColumnSpan="2"></Editor>
<Button x:Name="btnSend" Text="Send" BackgroundColor="Orange" Grid.Row="5" Grid.ColumnSpan="2"></Button>
</Grid>
【问题讨论】:
-
您苦苦挣扎的真正目的是什么?是字体吗?组件的样子?您期望什么作为答案,整个 xaml 代码适合您的设计要求?我不能很好地理解你的问题
-
我想改变组件样式
-
在入口处放置占位符,为分隔线放置框视图,为主体放置框架
-
你做过这个设计吗?
标签: c# xamarin.forms grid