Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

transparent datepicker

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 date picker new look

like image 269
Midhun Raj Avatar asked Oct 09 '13 06:10

Midhun Raj


1 Answers

Just change background color of your date picker

datepicker.backgroundColor = [UIColor yourcolor];
like image 62
Maul Avatar answered Oct 17 '22 23:10

Maul