草庐IT

uialertaction

全部标签

ios - 替代 iOS 9 的 UIAlertView?

UAlertView在iOS9及更高版本中已弃用。有什么替代方案?UIAlertView*new=[[UIAlertViewalloc]initWithTitle:@"Success"message:@"YourInAppPurchasesweresuccessfullyrestored"delegate:nilcancelButtonTitle:@"OK"otherButtonTitles:nil];[newshow]; 最佳答案 您可以使用此代码替换警报View:UIAlertController*alertController

ios - 替代 iOS 9 的 UIAlertView?

UAlertView在iOS9及更高版本中已弃用。有什么替代方案?UIAlertView*new=[[UIAlertViewalloc]initWithTitle:@"Success"message:@"YourInAppPurchasesweresuccessfullyrestored"delegate:nilcancelButtonTitle:@"OK"otherButtonTitles:nil];[newshow]; 最佳答案 您可以使用此代码替换警报View:UIAlertController*alertController

ios - 创建类似于邮件应用程序菜单的 iPhone 弹出菜单

当您想回复邮件时,我想创建一个类似于邮件应用程序中的弹出菜单。我在不止一个应用程序中看到过这种情况,所以我不确定框架中是否内置了一些东西或那里有一些示例代码。 最佳答案 在Swift中创建操作表代码已通过Swift5测试自iOS8起,UIAlertController与UIAlertControllerStyle.ActionSheet结合使用。UIActionSheet已弃用。下面是生成上图中操作表的代码:classViewController:UIViewController{@IBOutletweakvarshowAction

ios - 创建类似于邮件应用程序菜单的 iPhone 弹出菜单

当您想回复邮件时,我想创建一个类似于邮件应用程序中的弹出菜单。我在不止一个应用程序中看到过这种情况,所以我不确定框架中是否内置了一些东西或那里有一些示例代码。 最佳答案 在Swift中创建操作表代码已通过Swift5测试自iOS8起,UIAlertController与UIAlertControllerStyle.ActionSheet结合使用。UIActionSheet已弃用。下面是生成上图中操作表的代码:classViewController:UIViewController{@IBOutletweakvarshowAction

ios - 应用程序无法访问您的照片或视频 iOS 9

当我使用UIImagePicker访问我的照片库以选择照片时,该应用程序有时会显示黑屏,有时会显示一个屏幕,提示我必须授予我的应用程序访问照片的权限。但是当我转到“设置”->“隐私”->“照片”时,那里没有应用程序,而且在“设置”中也看不到该应用程序。我读到我必须向我的Info.plist添加两个值,但它们也没有用。有没有人遇到同样的错误?我正在使用xcode7、swift2.0和iOS9这是我提示用户访问相机的地方@IBActionfunccameraButtonPressed(sender:UIButton){letactionSheet=UIAlertController(tit

ios - 应用程序无法访问您的照片或视频 iOS 9

当我使用UIImagePicker访问我的照片库以选择照片时,该应用程序有时会显示黑屏,有时会显示一个屏幕,提示我必须授予我的应用程序访问照片的权限。但是当我转到“设置”->“隐私”->“照片”时,那里没有应用程序,而且在“设置”中也看不到该应用程序。我读到我必须向我的Info.plist添加两个值,但它们也没有用。有没有人遇到同样的错误?我正在使用xcode7、swift2.0和iOS9这是我提示用户访问相机的地方@IBActionfunccameraButtonPressed(sender:UIButton){letactionSheet=UIAlertController(tit

ios - 在 UIAlertController 中将图像添加到 UIAlertAction

我看过几个UIAlertControllers的屏幕截图,行的左侧有一个图像,但我没有在文档中看到它。视觉示例是这是我现在为我的Controller准备的代码:UIAlertController*view=[UIAlertControlleralertControllerWithTitle:@"MyTitle"message:@"SelectyouChoice"preferredStyle:UIAlertControllerStyleActionSheet];UIAlertAction*ok=[UIAlertActionactionWithTitle:@"OK"style:UIAler

ios - 在 UIAlertController 中将图像添加到 UIAlertAction

我看过几个UIAlertControllers的屏幕截图,行的左侧有一个图像,但我没有在文档中看到它。视觉示例是这是我现在为我的Controller准备的代码:UIAlertController*view=[UIAlertControlleralertControllerWithTitle:@"MyTitle"message:@"SelectyouChoice"preferredStyle:UIAlertControllerStyleActionSheet];UIAlertAction*ok=[UIAlertActionactionWithTitle:@"OK"style:UIAler

ios - 无法将类型 "ViewController.Type"的值转换为预期的参数类型 "UIViewController"

我正在尝试制作一个警报Controller,如果答案为“Ok”,那么它将对MapView执行转场。这是完整的代码:@IBActionfuncteste(_sender:Any){//CreatethealertcontrollerletalertController=UIAlertController(title:"Reservarvaga?",message:"UmavagaseráreservadaemEstaparEstacionamento.",preferredStyle:.alert)//CreatetheactionsletokAction=UIAlertAction(t

ios - 无法将类型 "ViewController.Type"的值转换为预期的参数类型 "UIViewController"

我正在尝试制作一个警报Controller,如果答案为“Ok”,那么它将对MapView执行转场。这是完整的代码:@IBActionfuncteste(_sender:Any){//CreatethealertcontrollerletalertController=UIAlertController(title:"Reservarvaga?",message:"UmavagaseráreservadaemEstaparEstacionamento.",preferredStyle:.alert)//CreatetheactionsletokAction=UIAlertAction(t