码迷,mamicode.com
首页 > 其他好文 > 详细

[UIAlertController & UIAlertAction] 简介

时间:2015-05-31 18:17:15      阅读:127      评论:0      收藏:0      [点我收藏+]

标签:

UIAlertController object displays an alert message to the user. This class replaces the UIActionSheet and UIAlertView classes for displaying alerts. After configuring the alert controller with the actions and style you want, present it using the presentViewController:animated:completion: method.

UIAlertController 对象显示了一条警告alert信息给用户。这个类取代了 UIActionSheet 和 UIAlertView 类来显示警告。在用你想要的动作和样式配置好警告 控制器之后,用 presentViewController:animated:completion: 方法来呈现它。

In addition to displaying a message to a user, you can associate actions with your alert controller to give the user a way to respond. For each action you add using the addAction: method, the alert controller configures a button with the action details. When the user taps that action, the alert controller executes the block you provided when creating the action object. 

除了显示一条信息给用户外,你还可以给警告控制器添加动作来提供一个给用户回答的方式。对于你使用addAction:方法添加的每一个动作,alert controller 都会配置一个带有动作细节的按钮。当用户敲击动作按钮时,动作控制器会执行你创建动作对象提供的方块。

 

UIAlertAction object represents an action that can be taken when tapping a button in an alert. You use this class to configure information about a single action, including the title to display in the button, any styling information, and a handler to execute when the user taps the button. After creating an alert action object, add it to a UIAlertController object before displaying the corresponding alert to the user.

UIAlertAction 对象呈现了一个在alert事件中一个按钮被敲击的时候可以被执行的动作 。 使用这个类来配置关于单个动作的信息,包括了显示在按钮上的title,任意的样式信息还有handler在按钮被敲击的时候来执行动作。在创建好alert 的action 对象后,在显示响应的alert前把它添加给一个 UIAlertController 对象。

 

[UIAlertController & UIAlertAction] 简介

标签:

原文地址:http://www.cnblogs.com/baaingSheep/p/4542341.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!