2011-01-12 64 views
0

Hy guys,Monotouch - 更改视图标题背景颜色

我有这个观点,我不知道如何改变它的标题背景颜色。此代码在这里只是改变视图的身体背景颜色:

var invoices = new MainInvoicesView(this); 
invoices.Title = "Invoices"; 
invoices.View.BackgroundColor = UIColor.Gray; 

任何想法?

问候,
克劳迪奥

回答

1

什么样的看法,这是? UIViews没有Title属性,所以你显然创建了一种不同的视图。

如果你有你的观点称为TitleLabel的UILabel,它是公共的,你应该能够只要致电:

invoices.TitleLabel.BackgroundColor = UIColor.Blue; 
+0

其实这是一个UIViewController,我的错误道歉。并且没有TitleLabel属性。 – Claudio 2011-01-12 22:45:03