个人资料

跳过导航链接首页 > 博客列表 > 博客正文

Xamarin.Forms文本输入控件Entry

:

简单的文本输入控件是Entry

使用方式如下:

<Entry x:Name="ScoreEntry" Placeholder="学分" Text="{Binding Score}" />

可以直接放在布局控件内,如StackLayout等,比较方便。

除此之外,还有一个输入控件,EntryCell,这个控件多了一个Label子元素,提示用户输入的内容。可以直接用于账户输入登录信息。不过使用起来较为苛刻,需要放置在TableSection内部实现。

<TableView Intent="Form">
  <TableSection>
    <EntryCell Label="账户" Placeholder="账户" Text="{Binding Username}"></EntryCell>
    <controls:ExtendedEntryCell IsPassword="True" Label="密码" Placeholder="密码" Text="{Binding Password}"></controls:ExtendedEntryCell>
  </TableSection>
</TableView>

·END·

songshizhao
最初发表2017/6/15 22:37:24 最近更新2017/6/15 22:37:24 7167
为此篇作品打分
10