简体   繁体   English

在Monotouch.Dialog中设置DateElement样式

[英]Styling DateElement in Monotouch.Dialog

I'm using MonoTouch.Dialog on my "settings" section on my app. 我在我的应用程序的“设置”部分使用MonoTouch.Dialog。 When I use the DateElement the background is all black, which doesn't really match the rest of the app. 当我使用DateElement ,背景全黑,这与应用程序的其余部分并不完全匹配。 Is there a way I can style everything around the "date wheels"? 有没有办法围绕“日期轮”设计一切?

You can override the CreatePicker method of DateElement , eg in your own MyDateElement to create your own customized UIDatePicker . 您可以覆盖CreatePicker的方法DateElement ,例如,在你自己的MyDateElement创建自己定制UIDatePicker

Another option, for iOS 5.0 (and more recent releases) is to set the Appearance (static property) of UIDatePicker to the style you like (to match your application). iOS 5.0(以及更新版本)的另一个选项是将UIDatePickerAppearance (静态属性)设置为您喜欢的样式(以匹配您的应用程序)。 That will ensure every UIDatePicker , created from MonoTouch.Dialog or yourself, will have the same look. 这将确保从MonoTouch.Dialog或您自己创建的每个UIDatePicker都具有相同的外观。 Eg 例如

 UIDatePicker.Appearance.BackgroundColor = UIColor.White;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM