简体   繁体   中英

Styling DateElement in Monotouch.Dialog

I'm using MonoTouch.Dialog on my "settings" section on my app. When I use the DateElement the background is all black, which doesn't really match the rest of the app. 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 .

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). That will ensure every UIDatePicker , created from MonoTouch.Dialog or yourself, will have the same look. Eg

 UIDatePicker.Appearance.BackgroundColor = UIColor.White;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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