mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 19:26:42 +08:00
feat(ios): dialog size can now use CSS or attribute like android (#8710)
closes https://github.com/NativeScript/NativeScript/issues/8698
This commit is contained in:
@ -446,6 +446,21 @@ export class View extends ViewCommon implements ViewDefinition {
|
||||
// set it has prefered content size to the controller presenting the dialog
|
||||
if (options.ios && options.ios.width > 0 && options.ios.height > 0) {
|
||||
controller.preferredContentSize = CGSizeMake(options.ios.width, options.ios.height);
|
||||
} else {
|
||||
//use CSS & attribute width & height if option is not provided
|
||||
let handler = () => {
|
||||
let w = <number>(this.width || this.style.width);
|
||||
let 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.off(View.loadedEvent, handler);
|
||||
};
|
||||
|
||||
this.on(View.loadedEvent, handler);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user