Avoid UIDatePicker transparency in iOS7

i just upgraded my app to iOS7 and found that date picker is transparent. It looks like I can see everything which is behind the date picker. How can I avoid this?

I tried to place date picker in another view. But still, its transparent. How can I avoid transparency of UIDatePicker? I've tried this link 1: can I change the font color of the datePicker in iOS7? but it didn't work. Thanks in advance.

Edit : I've added a UIDatePicker to a view named whiteborderview.

whiteborderview.backgroundColor = [UIColor whiteColor];

whiteborderview.alpha = 1.0;

[whiteborderview addSubview:dtPkrStart] 

and I got output like this

but still its transparent.

Edit2

I used this code and now its looking better than previous one

[UIView appearanceWhenContainedIn:[UITableView class], [UIDatePicker class], nil].backgroundColor = [UIColor colorWithWhite:1 alpha:1];

dtPkrStart.backgroundColor = [UIColor blackColor];

The date picker appearence changed like this

Answers


Just change background color of your date picker

datepicker.backgroundColor = [UIColor yourcolor];

you can add a uiview with any color behind the uidatepicker. it will work for you.


[UIView appearanceWhenContainedIn:[UITableView class], [UIDatePicker class], nil].backgroundColor =[UIColor colorWithWhite:1 alpha:0];
pickerView.backgroundColor=[UIColor whiteColor];
anotherView.backgroundColor=[UIColor whiteColor];//Another view on which you subview picker

Need Your Help

Variable declaration in a header file

c header

In case I have a variable that may be used in several sources - is it a good practice to declare it in a header? or is it better to declare it in a .c file and use extern in other files?

How to launch IE7 from a Windows Phone App?

c# windows-phone-7 windows-phone

How do you launch an instance of IE from an app? Is it better practice to page to a window with and browser window?