iOS alertController之actionsheet样式添加控件(类似自定义actionsheet)
来源:互联网 发布:淘宝一件代发有人下单 编辑:程序博客网 时间:2024/05/19 13:10
“`python
NSString*title=UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation) ? @"\n\n\n\n\n\n\n\n\n" : @"\n\n\n\n\n\n\n\n\n\n\n\n" ;UIAlertController*alert=[UIAlertController alertControllerWithTitle:@"快速兑换" message:title preferredStyle:UIAlertControllerStyleActionSheet];UIAlertAction*action=[UIAlertAction actionWithTitle:@"立即兑换" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {}]; UIAlertAction*action1=[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancelhandler:^(UIAlertAction * _Nonnull action) { }]; [alert addAction:action]; [alert addAction:action1]; UIView*img=[[UIView alloc]init];img.frame=CGRectMake(5,40, SCREEN_WIDTH-30, 220);// img.backgroundColor=[UIColor redColor];[alert.view addSubview:img];goodsname=@"123456手表";costCount=@"2000";totalCount=@"8000";lastCount=@"6000";NSString*str=[NSString stringWithFormat:@"立即兑换%@,消费%@积分,您当前账户剩余%@积分,兑换后剩余%@积分,点击下方的【立即兑换】按钮即可兑换。",goodsname,costCount,totalCount,lastCount];cnvUILabel*label=[[cnvUILabel alloc]initWithFrame:CGRectMake(15, 10, img.frame.size.width-30, [self getHeightWithString:str fontSize:15])];NSLog(@"---%f",[self getHeightWithString:str fontSize:15]);label.font=[UIFont systemFontOfSize:15];[img addSubview:label];[label cnv_setUILabelText:str andKeyWord1:goodsname andKeyWord2:costCount andKeyWord3:totalCount andKeyWord4:lastCount andKeyword5:@"【立即兑换】"];[label cnv_setUIlabelTextColor:[UIColor blackColor] andKeyWordColor:[UIColor redColor]];UIImageView*imagev=[[UIImageView alloc]initWithFrame:CGRectMake(15, 110, 100, 100)];imagev.image=[UIImage imageNamed:@"u1526"];StoreImageView*imgg=[[NSBundle mainBundle]loadNibNamed:@"StoreImageView" owner:nil options:nil][0];[imgg resetFrame:CGRectMake(15, 110, img.frame.size.width-30, 100)];imgg.storeImage.image=[UIImage imageNamed:@"u1526"];imgg.storeName.text=goodsname;imgg.count.text=costCount;imgg.lastGoods.text=@"剩10件";// [imgg drawRect:CGRectMake(15, 110, img.frame.size.width-30, 100)];[img addSubview:imgg];[self presentViewController:alert animated:YES completion:^{}];
“`
0 0
- iOS alertController之actionsheet样式添加控件(类似自定义actionsheet)
- UI--仿IOS控件之ActionSheet样式 and more..
- [ios]自定义的ActionSheet
- iOS开发之自定义ActionSheet视图
- iOS:AlerView、ActionSheet和AlertController的简单使用
- 自定义仿iOS的ActionSheet底部Dialog的样式
- ActionSheet
- ActionSheet
- IOS第二十五天——控件之ActionSheet
- 一劳永逸,iOS自定义ActionSheet封装流程
- 一劳永逸,iOS 自定义 ActionSheet 封装流程
- Swift基础之封装ActionSheet控件
- iOS AlertView、ActionSheet
- 【iOS学习】十一、ActionSheet
- iphone之ActionSheet介绍
- swift 之actionSheet 使用
- 仿IOS ActionSheet控件从下弹出Dialog
- iPhone开发【四】常用控件之ActionSheet与AlertView
- 如何获取用JS产生的DOM元素
- SPARK task执行与资源分配的关系
- Linux Shell编程-正则表达式
- macOS 10.12 不允许未知来源开发者的应用
- AndroidStudio 常见错误
- iOS alertController之actionsheet样式添加控件(类似自定义actionsheet)
- C语言:模拟实现printf函数——my_printf函数哦
- POJ3264 Balanced Lineup
- IE和DOM事件流的区别
- Android Service Framework (Native层的一个例子)
- bzoj 2662: [BeiJing wc2012]冻结
- CVPR 2016 Visual Tracking Paper Review
- React生命周期
- 浏览器关闭时弹出提示事件onbeforeunload