Monotouch.Dialog:节字体

Bil*_*ver 2 xamarin.ios monotouch.dialog

它可以访问节头和页脚的字体和颜色属性,还是我需要继承Section?我将我的UI改为全黑,除了我的章节页眉和页脚之外,一切看起来都很棒.

反思API:

class Login
{
    public string Version = "1.2.3";

    [Section ("Enter your credentials", "Email and password are required")]

    [Entry ("Enter your email address")]
    public string email;

    [Caption ("Password"), Password ("Enter your password")]
    public string password;

    [OnTap ("Login")]
    [Alignment (UITextAlignment.Center)]
    public string Logon;
}
Run Code Online (Sandbox Code Playgroud)

元素API:

return new RootElement ("Login") {
    new Section() {
        new StringElement ("Version", "1.2.3")
    },
    new Section ("Enter your credentials", "Email and password are required") {
        new EntryElement("Email", "Enter your email address", "azcoov"),
        new EntryElement("Password", "Enter your password", "password", true),
        new StringElement("Logon", Login)
    }
}
Run Code Online (Sandbox Code Playgroud)

mig*_*aza 12

部分页眉和页脚可以指定为字符串或UIViews,遗憾的是,它们之间没有任何内容.

如果要使用自定义标头/视图,则需要创建UILabel并在构造函数中将其用于Section类型(仅适用于Elements API).

就像是:

var header = new UILabel (new RectangleF (0, 0, 320, 48)){
    Font = UIFont.BoldSystemFontOfSize (22),
    BackgroundColor = UIColor.Red
}

new Section(header, footer) {
    ...
 }
Run Code Online (Sandbox Code Playgroud)