UIActinSheet和UIActionSheetDelegate
2016-07-18 11:05
495 查看
UIActinSheet和UIActionSheetDelegate
这个是就那个UIActionSheet对象 一般用来选择类型或者改变界面。。。还有更多应用
定义如下:
UIActionSheet *styleAlert = [[UIActionSheet alloc] initWithTitle:@"Choose a UIBarStyle:"
delegate:self cancelButtonTitle:@"Cancel"
destructiveButtonTitle:nil
otherButtonTitles: @"Default",
@"BlackOpaque",
@"BlackTranslucent",
nil,
nil];
// use the same style as the nav bar
styleAlert.actionSheetStyle = self.navigationController.navigationBar.barStyle;
//styleAlert.actionSheetStyle =UIActionSheetStyleAutomatic;
[styleAlert showInView:self.view];
[styleAlert release];
在委托里的操作代码如下:
- (void)actionSheet:(UIActionSheet *)modalView clickedButtonAtIndex:(NSInteger)buttonIndex
{
// Change the navigation bar style, also make the status bar match with it
switch (buttonIndex)
{
case 0:
{
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;
self.navigationController.navigationBar.barStyle = UIBarStyleDefault;
break;
}
case 1:
{
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleBlackOpaque;
self.navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;
break;
}
case 2:
{
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleBlackTranslucent;
self.navigationController.navigationBar.barStyle = UIBarStyleBlackTranslucent;
break;
}
}
}
相关文章推荐
- MiniUI快速入门教程(五)主框架布局
- Android 异步查询框架AsyncQueryHandler的使用
- MiniUI快速入门教程(四)表单开发
- MiniUI快速入门教程(三)CRUD
- UESTC 30 最短路
- (LeetCode)Guess Number Higher or Lower --- 猜数字
- MiniUI快速入门教程(二)编写第一个MiniUI程序:Hello, world!
- ios上 更改 状态栏(UIStatusBar)的颜色,你值得一看、收藏
- Android设置requestWindowFeature(Window.FEATURE_NO_TITLE)无效的解决办法
- MiniUI快速入门教程(一)下载安装
- 背景颜色转为UIImage
- java中queue的使用
- 最新ueditor(1.4.3.3)版本修改自定义上传路径
- STL 中队列的使用(queue)
- Instant Run requires 'Tools | Android | Enable ADB integration' to be enabled.
- 从UIImage的矩阵变换看矩阵运算的原理
- [Leetcode]Guess Number Higher or Lower II
- Git可视化极简易教程 — Git GUI使用方法
- IOS开发-UIView之动画效果的实现方法(合集)
- Android酷炫实用的开源框架(UI框架)