UIActionSheet 控件
2015-07-28 13:27
363 查看
UIActionSheet 相对来说比较简,下面来看看具体的实际效果,就是要界面上弹出可供用户选择的按钮。
需要实现的技术要点包括:
1:控件的使用直接上代码:固定的模式 定义变量 *action 分配内存空间 UIActionSheet alloc 初使化人内容,设置委托 等。
UIActionSheet *action = [[UIActionSheet alloc] initWithTitle:@"退出后将退回登录界面" delegate:self cancelButtonTitle:@"退出登录" destructiveButtonTitle:@"取消 " otherButtonTitles:nil, nil ];
[action showInView:self.view];
2:对按钮操作需要实现委托:UIActionSheetDelegate
前面两个是我实现tabelView的委托。
@interface SettingViewController : UIViewController<UIActionSheetDelegate>{
3:实现委托方法
-(void) actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex{
if(buttonIndex!= [actionSheet destructiveButtonIndex]){
//根据点击不同的按钮实现不同方法。
}
}
到此就完成了一个 UIActionSheet 的过程。
需要实现的技术要点包括:
1:控件的使用直接上代码:固定的模式 定义变量 *action 分配内存空间 UIActionSheet alloc 初使化人内容,设置委托 等。
UIActionSheet *action = [[UIActionSheet alloc] initWithTitle:@"退出后将退回登录界面" delegate:self cancelButtonTitle:@"退出登录" destructiveButtonTitle:@"取消 " otherButtonTitles:nil, nil ];
[action showInView:self.view];
2:对按钮操作需要实现委托:UIActionSheetDelegate
前面两个是我实现tabelView的委托。
@interface SettingViewController : UIViewController<UIActionSheetDelegate>{
3:实现委托方法
-(void) actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex{
if(buttonIndex!= [actionSheet destructiveButtonIndex]){
//根据点击不同的按钮实现不同方法。
}
}
到此就完成了一个 UIActionSheet 的过程。
相关文章推荐
- ogre接入cegui
- Scala界面GUI编程
- easyui的datebox最简单的方法来格式化
- druid 连接池配置
- 建造者模式-Builder Pattern
- scala函数的call-by-name和call-by-value 区别
- 解决iOS7,iOS8UITableView分割线距左边有距离的办法
- ios -UI-UI-菜单栏+导航栏
- UIImageView实现动画
- Quintus小游戏制作之Beta(二)
- 关于UITableView中的 TableFooterView的使用介绍
- JavaSE实战——GUI简述、用户登录注册最终版、模拟微信打飞机游戏实例
- HTML textarea的value 问题
- 在iOS8系统下,UITabbar上的item自定义背景色和图片问题
- 自己动手实现一个队列LGQueue(刚刚)
- android 推送 mosquitto MQTT
- UIView之动画效果的实现方法(合集
- django @login_required
- 采用easyui tree编写简单角色权限代码的方法
- iOS-UI-02 UILabel UIButton