mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
feat(dialogs): Setting the size of popup dialog thru dialog options (#8041)
* Added iOS specific height and width attributes to ShowModalOptions * Set the height and width of the popup dialog to the presenting controller * dialog options ios attributes presentationStyle, height & width are made optional * Updated NativeScript.api.md for public API changes * Update with git properties * Public API * CLA update
This commit is contained in:
committed by
Alexander Vakrilov
parent
49a7607f4e
commit
cd5703a6b7
@@ -79,7 +79,15 @@ export interface ShowModalOptions {
|
||||
/**
|
||||
* The UIModalPresentationStyle to be used when showing the dialog in iOS .
|
||||
*/
|
||||
presentationStyle: any /* UIModalPresentationStyle */
|
||||
presentationStyle?: any; /* UIModalPresentationStyle */
|
||||
/**
|
||||
* width of the popup dialog
|
||||
*/
|
||||
width?: number;
|
||||
/**
|
||||
* height of the popup dialog
|
||||
*/
|
||||
height?: number;
|
||||
}
|
||||
android?: {
|
||||
/**
|
||||
|
||||
@@ -432,6 +432,11 @@ export class View extends ViewCommon implements ViewDefinition {
|
||||
controller.modalPresentationStyle = UIModalPresentationStyle.FullScreen;
|
||||
} else {
|
||||
controller.modalPresentationStyle = UIModalPresentationStyle.FormSheet;
|
||||
//check whether both height and width is provided and are positive numbers
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
if (options.ios && options.ios.presentationStyle) {
|
||||
|
||||
Reference in New Issue
Block a user