我正在尝试使用MonoTouch编写应用程序。我需要设置导航栏的背景颜色。我想将它设置为橙色。这似乎是一件容易的事情,但我似乎无法让它工作。目前,我在AppDelegate.cs文件中执行以下操作:单点触摸设置导航栏颜色
this.window = new UIWindow (UIScreen.MainScreen.Bounds);
this.rootNavigationController = new UINavigationController();
UIColor backgroundColor = new UIColor(74, 151, 223, 255);
this.rootNavigationController.NavigationBar.BackgroundColor = UIColor.Orange;
但是,导航栏颜色仍然是默认颜色。如何设置导航栏的背景颜色?
下面的代码不会做你所期望的:'new UIColor(74,151,223,255)',因为.ctor接受'float',而不是字节。如果你想使用'byte'来创建你的颜色,请尝试使用'UIColor.FromRGBA'。 – poupou