File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ class UIViewAutoSizeUIViewAutoSize extends UIView {
33
33
if ( ! view ) {
34
34
return CGSizeZero ;
35
35
}
36
- // if message is set on the dialog
36
+ // if message is set on the dialog
37
37
// this is called with an infinite boundsSize.width which would
38
38
// make the view size itself to as big as possible
39
39
// which we never want
@@ -65,7 +65,6 @@ function createUIViewAutoSizeUIViewAutoSize(view: View) {
65
65
view . _setupAsRootView ( { } ) ;
66
66
view . parent = Application . getRootView ( ) ;
67
67
view . _isAddedToNativeVisualTree = true ;
68
- view . callLoaded ( ) ;
69
68
self . _view = view ;
70
69
self . addSubview ( view . nativeViewProtected ) ;
71
70
( view . nativeViewProtected as UIView ) . autoresizingMask = UIViewAutoresizing . FlexibleWidth | UIViewAutoresizing . FlexibleHeight ;
@@ -106,6 +105,11 @@ class MDCAlertControllerImpl extends MDCAlertController {
106
105
}
107
106
viewDidLoad ( ) {
108
107
super . viewDidLoad ( ) ;
108
+ // we call callLoaded here to prevent callLoaded from triggering loadView to be called
109
+ // again from callLoaded in loadView (controller.view would not be set yet)
110
+ if ( this . accessoryView instanceof UIViewAutoSizeUIViewAutoSize ) {
111
+ this . accessoryView . _view . callLoaded ( ) ;
112
+ }
109
113
if ( this . _disableContentInsets ) {
110
114
( this . view as MDCAlertControllerView ) . contentInsets = UIEdgeInsetsZero ;
111
115
}
You can’t perform that action at this time.
0 commit comments