【发布时间】:2018-07-19 16:13:53
【问题描述】:
我有一个非常简单的 Xamarin.Forms 应用程序,仅包含一个带有 Content 的 TableView。
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:TableTest"
x:Class="TableTest.MainPage">
<TableView>
<TableRoot>
<TableSection Title="Foo">
<EntryCell Label="Cell1"
x:Name="TestCell"/>
<EntryCell Label="Cell2"
x:Name="TestCell2"/>
</TableSection>
</TableRoot>
</TableView>
我现在通过重写 OnAppearing() 方法来设置单元格的文本。
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
protected override void OnAppearing()
{
base.OnAppearing();
TestCell.Text = "Zazzle";
TestCell2.Text = "Brrzzz";
}
}
这在 Android 上运行良好,但使用 UWP 时,第一个 Cell 会显示为折叠状态,并且只有在将鼠标移到单元格上后才会返回到预期的状态。 This is a screenshot of the undesirable result.我做错了什么?
【问题讨论】:
标签: xamarin.forms