一,效果图。

二,代码。

RootViewController.h

#import <UIKit/UIKit.h>

@interface RootViewController : UIViewController
<UIActionSheetDelegate> @end

RootViewController.m

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UIActionSheet *actionSheet=[[UIActionSheet alloc]initWithTitle:nil delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:nil otherButtonTitles:@"手机找回密码", nil];
[actionSheet showInView:self.view]; }
#pragma mark - UIActionSheetDelegate
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
switch (buttonIndex) {
case 0:
{
NSLog(@"--0--");
}
break;
case 1:
{
NSLog(@"--1--");
}
break;
default:
break;
}
}
- (void)willPresentActionSheet:(UIActionSheet *)actionSheet
{
for (UIView *subViwe in actionSheet.subviews) {
if ([subViwe isKindOfClass:[UIButton class]]) {
UIButton *button = (UIButton*)subViwe;
button.titleLabel.font=[UIFont systemFontOfSize:15];
[button setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; }
}
}

最新文章

  1. windows qt 编译 boost 添加 路径
  2. JS中new都是干了些什么事情
  3. android4.x获取(也可监测)外置sd路径和读写
  4. 算法导论_ch2
  5. Localdb Attach Problem
  6. Hadoop安装(2)安装hadoop 前的centos 设置
  7. FastDFS的学习与使用(大量帖子)
  8. spring多数据源的配置(转)
  9. OSG(OpenSceneGraphcow.osg)配置笔记
  10. 关于flex4 list 高度适应内容
  11. 从parcel.js打包出错,到拥抱nvm
  12. TF.learn学习
  13. angularjs html 转义
  14. Axure RP 8 软件介绍
  15. 报表工具-ECharts 特性介绍
  16. mui getJSON实现jsonp跨域
  17. babel(一)
  18. (转)HTTPS到底是个啥玩意儿?
  19. Python 合并两个列表的多种方式,合并两个字典的多种方式
  20. 自动化jenkins报:ModuleNotFoundError: No module named &#39;common&#39;

热门文章

  1. Liferay7 BPM门户开发之2: BPMN 2.0 规范入门 (Activiti BPMN extensions)
  2. 开发ASP.NET MVC 在线录音录像(音视频录制并上传)
  3. 56.storm 之 hello world (集群模式)
  4. Ubuntu 14.04TLS和CentOS-6(64bit)上安装Nginx
  5. ScreenOper
  6. MVC3学习:利用jquery+ajax生成二维码(支持中文)
  7. Android的Fragment的第一种声明方式
  8. TCP保活的必要性
  9. Java配置分离之Spring远程配置
  10. Ubuntu中安装Sublime Text 3并安装Package Control