自定义UIActionSheet

//还没有尝试过,先保存在这   http://www.zpluz.com/forum.php?mod=viewthread&tid=2010
UIActionSheet *sheet=[[UIActionSheet alloc] initWithTitle:@"请登陆会员中心" delegate:self cancelButtonTitle:@"返回" destructiveButtonTitle:@"登录" otherButtonTitles:nil];
    [sheet showInView:[UIApplication sharedApplication].keyWindow];
    UILabel *title = [[sheet subviews] objectAtIndex:0];
    title.font = [UIFont boldSystemFontOfSize:18];
    [title setTextColor:[UIColor blackColor]];
    [title setShadowOffset:CGSizeMake(2, 2)];
    [title setShadowColor:[UIColor whiteColor]];


  1. UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:@"Dynamic UIActionSheet"   delegate:self  
  2.                                               cancelButtonTitle:nil  
  3.                                          destructiveButtonTitle:nil  
  4.                                               otherButtonTitles:nil];  
  5.     // 逐个添加按钮(比如可以是数组循环)  
  6.     [sheet addButtonWithTitle:@"Item A"];  
  7.     [sheet addButtonWithTitle:@"Item B"];  
  8.     [sheet addButtonWithTitle:@"Item C"];  
  9.       
  10.     // 同时添加一个取消按钮  
  11.     [sheet addButtonWithTitle:@"Cancel"];  
  12.     // 将取消按钮的index设置成我们刚添加的那个按钮,这样在delegate中就可以知道是那个按钮  
  13.     sheet.cancelButtonIndex = sheet.numberOfButtons-1;  
  14.     [sheet showFromRect:view.bounds inView:view animated:YES];

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值