简体   繁体   中英

UIDatePicker shows fine in iPhone but it doesn't in iPad

I'm showing a UIDatePicker in an UITableViewController and it looks fine. When a segue the same controller as a popover the UIDatePicker doesn't look good.

I put the UIDatePicker inside a UITableViewController.

This one is from the iPhone 在此处输入图片说明 And this one is from the iPad

Your iPad picker looks just fine. I think there is another view covering a part of it. Try this in the debugger:

po [self.view recursiveDescription]

and see if you can find the view in this way.

I can reproduce this problem when all of the following are true:

  • The date picker is inside a table view cell
  • The table view controller is being presented modally
  • The modal presentation style is 'Form sheet'
  • The device is an iPad

The best workaround I have found is to change the modal presentation style. 'Page sheet' works fine, for example.

This seems like an OS bug.

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