Skip to content

Commit f98c268

Browse files
authored
Merge pull request #26 from NativeScript/tgpetrov/ipad-issue
fix: ipad issue
2 parents d2bc096 + 05f05c9 commit f98c268

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/datetimepicker.ios.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export class DateTimePickerStyle extends DateTimePickerStyleBase {
1313
export class DateTimePicker extends DateTimePickerBase {
1414
public static PICKER_DEFAULT_MESSAGE_HEIGHT = 192;
1515
public static PICKER_WIDTH_INSETS = 16;
16+
public static PICKER_WIDTH_PAD = 304;
1617
public static PICKER_DEFAULT_TITLE_OFFSET = 26.5;
1718
public static PICKER_DEFAULT_TITLE_HEIGHT = 16;
1819
public static PICKER_DEFAULT_MESSAGE = "\n\n\n\n\n\n\n\n\n";
@@ -72,7 +73,8 @@ export class DateTimePicker extends DateTimePickerBase {
7273
const alertController = UIAlertController.alertControllerWithTitleMessagePreferredStyle(
7374
alertTitle, DateTimePicker.PICKER_DEFAULT_MESSAGE, UIAlertControllerStyle.ActionSheet);
7475
const alertSize = Math.min(alertController.view.frame.size.width, alertController.view.frame.size.height);
75-
const pickerViewWidth = alertSize - DateTimePicker.PICKER_WIDTH_INSETS;
76+
const pickerViewWidth = UIDevice.currentDevice.userInterfaceIdiom === UIUserInterfaceIdiom.Pad ?
77+
DateTimePicker.PICKER_WIDTH_PAD : alertSize - DateTimePicker.PICKER_WIDTH_INSETS;
7678

7779
let pickerContainerFrameTop = DateTimePicker.PICKER_DEFAULT_TITLE_OFFSET;
7880
if (options.title) {

0 commit comments

Comments
 (0)