File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -75,9 +75,25 @@ - (UIView *)view
75
75
76
76
CGRect pickerBounds = picker.bounds ;
77
77
78
+
79
+ // Detect the content size category
80
+ UIContentSizeCategory contentSize = UIApplication.sharedApplication .preferredContentSizeCategory ;
81
+ int heightIncrement = 0 ;
82
+
83
+ // Adjust height based on content size category
84
+ if ([contentSize isEqualToString: UIContentSizeCategoryAccessibilityLarge]) {
85
+ heightIncrement = 15 ;
86
+ } else if ([contentSize isEqualToString: UIContentSizeCategoryAccessibilityExtraLarge]) {
87
+ heightIncrement = 40 ;
88
+ } else if ([contentSize isEqualToString: UIContentSizeCategoryAccessibilityExtraExtraLarge]) {
89
+ heightIncrement = 70 ;
90
+ } else if ([contentSize isEqualToString: UIContentSizeCategoryAccessibilityExtraExtraExtraLarge]) {
91
+ heightIncrement = 90 ;
92
+ }
93
+
78
94
// height
79
95
double pickerHeight = [self getPickerHeight: alertView];
80
- int alertHeightPx = iPad ? (title ? 300 : 260 ) : (title ? 370 : 340 );
96
+ int alertHeightPx = iPad ? (title ? 300 : 260 ) : (title ? 370 + heightIncrement : 340 + heightIncrement );
81
97
NSLayoutConstraint *height = [NSLayoutConstraint constraintWithItem: alertView attribute: NSLayoutAttributeHeight relatedBy: NSLayoutRelationEqual toItem: nil attribute: NSLayoutAttributeNotAnAttribute multiplier: 1 constant: alertHeightPx];
82
98
[alertView addConstraint: height];
83
99
pickerBounds.size .height = pickerHeight;
You can’t perform that action at this time.
0 commit comments