MonoTouch.Dialog:为 EntryElement 设置条目对齐方式 [英] MonoTouch.Dialog: Setting Entry Alignment for EntryElement

查看:25
本文介绍了MonoTouch.Dialog:为 EntryElement 设置条目对齐方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 EntryElement 按原样输入数据会导致输入的数据在中间对齐.

Using the EntryElement to enter data as is results in the data being entered being aligned sort of in the middle.

如何指定条目应在 iPad 上右对齐.

How do I specify that the entry should be right aligned on an iPad.

例如:

推荐答案

您是否尝试过在 EntryElement 上覆盖 CreateTextField ?

Have you tried overriding CreateTextField on EntryElement ?

这应该让您完全控制如何创建用于元素条目部分的 UITextField.

That should give you complete control on how to create the UITextField being used for the entry part of the element.

更新请注意,如果您覆盖 CreateTextField,您还应该覆盖 Cellkey 属性,以确保该单元格不会通过 UITableView 单元格共享机制与其他 EntryElements 共享.

Update Notice that if you override CreateTextField, you should also override the Cellkey property, to ensure that this cell is not shared through the UITableView cell-sharing machinery with other EntryElements.

当然,您需要在被调用之前知道正确的大小(或延迟设置某些属性,直到您确定为止).

Of course you'll need to know the right size before being called (or delay settings some properties until you know for sure).

这篇关于MonoTouch.Dialog:为 EntryElement 设置条目对齐方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆