Talha Ch Talha Ch - 11 days ago 5
iOS Question

How to change ActionSheetDatePicker origin on iPAD

I'm opening ActionSheetDatePicker on a table view cell tap as:

[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];


But it shows like this on iPAD.
enter image description here
How can I change it's direction? I'm using ActionSheetPicker-3.0

Answer

To fix this try to change origin argument like this.

[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];
Comments