2

我是一个完全的 Monotouch n00bie,我真的很难找出如何更改分组节标题的字体和行大小。

我正在创建我的 IUTableViewSource 并将其附加到我的 UITableView 但是更改所有节标题的语法在哪里?(每个分组部分上方的那些)。

我查看了 XCode IB 并猜到了 tableView.Header/Section/HeaderFont/Style 等

来自 ASP.NET c#,这是一项艰苦的工作!

4

1 回答 1

0

您可以使用 MonoTouch.Dialog 轻松做到这一点。

https://github.com/migueldeicaza/MonoTouch.Dialog

它还带有 MonoTouch,只需添加对它的引用并添加 using 语句就可以了!

RootElement root = new RootElement("MyRootName");
Section mySection = new Section();
UIView mySectionHeaderView = // Do stuff here to make your custom header. Add UILabels, etc etc.
mySection.HeaderView = mySectionHeaderView;

StringElement strElement = new StringElement("This is a table cell"); // just to get you started
mySection.Add(strElement); // Add element to the section.
root.Add(mySection); // Add my section to the root element.
Root = root; // Sets my temp root, to the DialogViewControllers actual Root. You do this rather than working directly on Root to stop some display issues.

这假定您获得 MonoTouch.Dialog 并且您的类是 DialogViewController 的子类。一旦我发现了这个 MT.DI,我就很少再去使用常规的 UITableViews 了!

于 2012-11-15T05:55:16.947 回答