mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 19:26:42 +08:00
fix ios dialogs.action when message/title is null
This commit is contained in:
@ -403,10 +403,14 @@ function showUIAlertController(alertController: UIAlertController) {
|
|||||||
|
|
||||||
var lblColor = dialogsCommon.getLabelColor();
|
var lblColor = dialogsCommon.getLabelColor();
|
||||||
if (lblColor) {
|
if (lblColor) {
|
||||||
var title = NSAttributedString.alloc().initWithStringAttributes(alertController.title, <any>{ [NSForegroundColorAttributeName]: lblColor.ios });
|
if (alertController.title) {
|
||||||
alertController.setValueForKey(title, "attributedTitle");
|
var title = NSAttributedString.alloc().initWithStringAttributes(alertController.title, <any>{ [NSForegroundColorAttributeName]: lblColor.ios });
|
||||||
var message = NSAttributedString.alloc().initWithStringAttributes(alertController.message, <any>{ [NSForegroundColorAttributeName]: lblColor.ios });
|
alertController.setValueForKey(title, "attributedTitle");
|
||||||
alertController.setValueForKey(message, "attributedMessage");
|
}
|
||||||
|
if (alertController.message) {
|
||||||
|
var message = NSAttributedString.alloc().initWithStringAttributes(alertController.message, <any>{ [NSForegroundColorAttributeName]: lblColor.ios });
|
||||||
|
alertController.setValueForKey(message, "attributedMessage");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
viewController.presentModalViewControllerAnimated(alertController, true);
|
viewController.presentModalViewControllerAnimated(alertController, true);
|
||||||
|
Reference in New Issue
Block a user