Skip to content

Instantly share code, notes, and snippets.

@bithavoc
Created September 25, 2014 00:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bithavoc/303044f7224ccb0be1a8 to your computer and use it in GitHub Desktop.
Save bithavoc/303044f7224ccb0be1a8 to your computer and use it in GitHub Desktop.
Fix iOS8 UI datepicker issue.
// https://medium.com/@bithavoc/uidatepicker-presentation-issue-on-ios-8-98215118a27f
if(NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_7_1) {
[[UITableView appearanceWhenContainedIn:[UIDatePicker class], nil] setBackgroundColor:nil]; // for iOS 8
} else {
[[UITableViewCell appearanceWhenContainedIn:[UIDatePicker class], [UITableView class], nil] setBackgroundColor:[UIColor colorWithWhite:0.0 alpha:0.0]]; // for iOS 7
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment