From eb93c97ab252cd91f6c7c1d02813db0c8980c167 Mon Sep 17 00:00:00 2001 From: Lucas Farah Date: Tue, 19 Jul 2016 18:06:34 -0300 Subject: [PATCH] Fixed appearance problems --- Demo/Library/DatePickerDialog.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Demo/Library/DatePickerDialog.swift b/Demo/Library/DatePickerDialog.swift index 5f77206..f943b14 100644 --- a/Demo/Library/DatePickerDialog.swift +++ b/Demo/Library/DatePickerDialog.swift @@ -54,7 +54,11 @@ public class DatePickerDialog: UIView { /* Handle device orientation changes */ func deviceOrientationDidChange(notification: NSNotification) { - close() // For now just close it + + self.frame = CGRectMake(0, 0, UIScreen.mainScreen().bounds.size.width, UIScreen.mainScreen().bounds.size.height) + let screenSize = countScreenSize() + let dialogSize = CGSizeMake(300,230 + kDatePickerDialogDefaultButtonHeight + kDatePickerDialogDefaultButtonSpacerHeight) + dialogView.frame = CGRectMake((screenSize.width - dialogSize.width) / 2, (screenSize.height - dialogSize.height) / 2, dialogSize.width, dialogSize.height) } /* Create the dialog view, and animate opening the dialog */ @@ -114,6 +118,8 @@ public class DatePickerDialog: UIView { } self.removeFromSuperview() + self.setupView() + } }