【发布时间】:2016-02-18 13:38:46
【问题描述】:
我已经为 Xamarin 跨平台应用程序中的设置页面实现了 TableView。在这个高度中,每个单元格的高度都是固定的,并且不会根据内部的 View 进行扩展。如果 ViewCell 是单行高或双行高,则 ViewCell 可以很好地显示项目。如果有多个控件(如按钮+2标签或包含段落的标签),则其高度有限,视图不显示。
<TableSection Title="Settings heading">
<ViewCell>
<!-- Image Type Settings -->
<StackLayout HorizontalOptions="StartAndExpand"
Orientation="Vertical"
VerticalOptions="StartAndExpand">
<StackLayout HorizontalOptions="Fill"
Orientation="Horizontal"
VerticalOptions="StartAndExpand">
<Label HorizontalOptions="StartAndExpand" Text="Key" />
<Label HorizontalOptions="EndAndExpand"
Text="Value"
TextColor="Green" />
</StackLayout>
<Label HorizontalOptions="Fill"
Text="---- Long Long Paragraph here about setting, of which only one line will be rendered in ViewCell ----"
VerticalOptions="StartAndExpand" />
</StackLayout>
</ViewCell>
</TableSection>
我尝试增加 ViewCell、TableView VerticalOptions 的高度,但没有任何结果。
【问题讨论】:
标签: xamarin xamarin.forms