自定义Alert
2015-06-16 15:59
176 查看
UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"添加明星阵容" message:nil delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"添加", nil]; //UIView *view = [[UIView alloc]initWithFrame:CGRectMake(180, 5, 85, 155)]; UIScrollView *scroll=[[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 400, 155)]; [scroll setContentSize:CGSizeMake(400, 1280)]; scroll.delegate = self; //[view addSubview:scroll]; for (int i = 0; i < [arr count]; i ++) { UIButton *btn = [[UIButton alloc] init]; //btn.frame = CGRectMake(<#CGFloat x#>, <#CGFloat y#>, <#CGFloat width#>, <#CGFloat height#>) } UIButton *btn=[[UIButton alloc] initWithFrame:CGRectMake(0, 0, 80, 45)]; btn.backgroundColor = [UIColor redColor]; [btn setTitle:[arr objectAtIndex:2] forState:UIControlStateNormal]; [scroll addSubview:btn]; if (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1) { [alertView setValue:scroll forKey:@"accessoryView"]; }else{ [alertView addSubview:scroll]; } [alertView show];
相关文章推荐
- 新学到的两个关键字IBInspectable / IBDesignable
- AndroidのLoaderManager管理Loader实现异步动态加载数据
- android bluedroid调试
- java指定agent的参数
- XHTML 结构化:使用 XHTML 重构网站
- 将HTML格式的String转化为HTMLElement
- JavaScript中的一些细节
- javascript中0级DOM和2级DOM事件模型浅析
- window.onload,&lt;body onload=&quot;function()&quot;&gt;, document.onreadystatechange, httpRequest.onreadystatechang
- javascript中定义事件的三种方式
- javascript的全局变量
- 【Nutch2.2.1基础教程之1】nutch相关异常
- 【Nutch2.2.1基础教程之6】Nutch2.2.1抓取流程
- Hadoop1.2.1伪分布模式安装指南
- Hadoop基本原理之一:MapReduce
- 8大排序算法图文讲解
- 【Nutch2.2.1基础教程之3】Nutch2.2.1配置文件
- Hadoop配置文件
- Hadoop入门经典:WordCount
- 使用ToolRunner运行Hadoop程序基本原理分析