如何在iPAD上更改ActionSheetDatePicker原点

时间:2016-11-21 11:11:55

标签: ios ipad datepicker uiactionsheet

我在表格视图单元格上打开ActionSheetDatePicker为:

[ActionSheetDatePicker showPickerWithTitle:@"Select Date"
                       datePickerMode:UIDatePickerModeDate
                       selectedDate:[NSDate date]
                           doneBlock:^(ActionSheetDatePicker *picker, id selectedDate, id origin) {                                                     dateString = [dateFormatter stringFromDate:selectedDate];
                                [self fetchHistoryForDate];
                                }
              cancelBlock:^(ActionSheetDatePicker *picker) {
                           NSLog(@"Block Picker Canceled");}
                                                origin:tableView];

但它在iPAD上显示如下。 enter image description here 我怎样才能改变它的方向?我正在使用ActionSheetPicker-3.0

1 个答案:

答案 0 :(得分:1)

要解决此问题,请尝试更改此origin参数。

[ActionSheetDatePicker showPickerWithTitle:@"Select Date"
                       datePickerMode:UIDatePickerModeDate
                       selectedDate:[NSDate date]
                           doneBlock:^(ActionSheetDatePicker *picker, id selectedDate, id origin) {                                                     dateString = [dateFormatter stringFromDate:selectedDate];
                                [self fetchHistoryForDate];
                                }
              cancelBlock:^(ActionSheetDatePicker *picker) {
                           NSLog(@"Block Picker Canceled");}
                                                origin:tableView.tableFooterView];