UIDatePicker以错误的方向打开

时间:2016-03-11 11:49:18

标签: ios objective-c uidatepicker

我正在使用Objective -c创建一个iOS应用。

我正在使用两个UIViewController

  1. newviewController(portrait)。
  2. editviewController(landscape)。

    newUIViewController - >文本框(datePicker) - >按键  第一次打开datePicker肖像。

    enter image description here

    editviewcontroller - > UITableView - > UIButton(添加行,保存,取消) - > UITableView每行删除按钮 首先添加行,然后单击以删除行和取消按钮单击以newuiviewcontroller显示datepicker旋转?看我的样本图片

    -(BOOL)shouldAutorotate
     {
       return  YES;
     }
    
     - (NSUInteger ) supportedInterfaceOrientations
     {
         return (UIInterfaceOrientationMaskPortrait);
     }
    
      - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
     {
         return UIInterfaceOrientationPortrait;
     }
    how to solve this problems?
    

0 个答案:

没有答案