Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/100.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何使用UIAction Sheet在一行中添加四个按钮_Ios_Uiactionsheet - Fatal编程技术网

Ios 如何使用UIAction Sheet在一行中添加四个按钮

Ios 如何使用UIAction Sheet在一行中添加四个按钮,ios,uiactionsheet,Ios,Uiactionsheet,我是ios新手。我在我的项目中使用了行动表。我想问一下,为了在行动表中添加四个按钮,我能做些什么 这是我的try代码,但它在四个不同的行上显示了四个按钮: UIActionsheet已被弃用,不再在iOS8中工作。 UIActionsheet将由UIAlertController替换。您的问题可能是由于此更新 UIAlertController为您提供定制AlertView的全部功能。 如果应用商店中的应用程序正在使用UIAlertView,则您的应用程序将在iOS 8中被破坏 如何使用UIAl

我是ios新手。我在我的项目中使用了行动表。我想问一下,为了在行动表中添加四个按钮,我能做些什么

这是我的try代码,但它在四个不同的行上显示了四个按钮:
UIActionsheet已被弃用,不再在iOS8中工作。 UIActionsheet将由UIAlertController替换。您的问题可能是由于此更新

UIAlertController为您提供定制AlertView的全部功能。 如果应用商店中的应用程序正在使用UIAlertView,则您的应用程序将在iOS 8中被破坏

如何使用UIAlertController在Github上查看此演示


用于自定义视图(如AlertViewController)的库是
iOS8
Swift
语言中的
UIActionsheet

var alert = UIAlertController(title: "NewProject", message:"Password is not mathch.", preferredStyle: UIAlertControllerStyle.ActionSheet)
            alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler:{ (ACTION :UIAlertAction!)in

                println("User click Ok button")

                self.txtPassword.becomeFirstResponder()

            }))

            self.presentViewController(alert, animated: true, completion: nil)

我说的是UIAction Sheet而不是UIAlertViewController。实际上它是一个像actionsheet一样弹出视图的类,您可以使用addsubview将控件添加到此视图。如果anyquery询问我为什么添加该图像?为了正确解释我的需要…为什么不使用带有按钮的选项卡栏/工具栏?我们可以使用工具栏更改图像吗???什么意思?我真的不明白你想做什么。你说“我正在使用行动表”,但在你添加的图片中,我看不到任何与行动表相关的内容。您是否正在尝试为图像底部的4个按钮使用操作表?(这是我看过你的答案后唯一能想到的事情。)我想我已经问过如何在一行中显示这四个按钮??对不起,我不知道在操作表中,但只看一个视图并在其中添加四个按钮。
var alert = UIAlertController(title: "NewProject", message:"Password is not mathch.", preferredStyle: UIAlertControllerStyle.ActionSheet)
            alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler:{ (ACTION :UIAlertAction!)in

                println("User click Ok button")

                self.txtPassword.becomeFirstResponder()

            }))

            self.presentViewController(alert, animated: true, completion: nil)