gpt4 book ai didi

c# - MonoTouch 对话框自定义字体

转载 作者:塔克拉玛干 更新时间:2023-11-02 10:18:09 25 4
gpt4 key购买 nike

我是 MonoTouch 的新手,注意到 MonoTouch Dialog api 非常有用。我想要实现的是这样的:

enter image description here http://img641.imageshack.us/img641/8514/consumentstartscherm.png

所以我想要表格 View 单元格中的常规文本..但我该如何实现呢?目前我将我的文本放在标题部分,但那是粗体。

最佳答案

这样的事情会让你接近:

        var label = new UILabel ();
var frame = label.Frame;
frame.Inflate (0, 32);
label.Frame = frame;
label.Font = UIFont.BoldSystemFontOfSize (32);
label.Text = "Ad4You";
label.TextAlignment = UITextAlignment.Center;
label.BackgroundColor = UIColor.FromWhiteAlpha (0f, 0f);

Section s = new Section ("Ad4You");
s.HeaderView = label;

s.Add (new StyledMultilineElement (String.Empty,
"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
UITableViewCellStyle.Subtitle));

var root = new RootElement ("Home");
root.Add (s);

var dv = new DialogViewController (root, true) { Autorotate = true };
NavigationController.PushViewController (dv, true);

享受 MonoTouch 和 MonoTouch.Dialog 的乐趣:-)

关于c# - MonoTouch 对话框自定义字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7850480/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com