mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(ios): race condition when setting preferredContentSize on view controller (#10179)
This commit is contained in:
@@ -479,13 +479,13 @@ export class View extends ViewCommon implements ViewDefinition {
|
||||
} else {
|
||||
//use CSS & attribute width & height if option is not provided
|
||||
const handler = () => {
|
||||
if (controller) {
|
||||
if (this.viewController) {
|
||||
const w = <number>(this.width || this.style.width);
|
||||
const h = <number>(this.height || this.style.height);
|
||||
|
||||
//TODO: only numeric value is supported, percentage value is not supported like Android
|
||||
if (w > 0 && h > 0) {
|
||||
controller.preferredContentSize = CGSizeMake(w, h);
|
||||
this.viewController.preferredContentSize = CGSizeMake(w, h);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user