- 浏览: 2957915 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (893)
- android (110)
- iphone (198)
- java (79)
- JavaScript手册-目录 (9)
- JavaScript手册-Array (19)
- JavaScript手册-Boolean (5)
- JavaScript手册-Date (50)
- JavaScript手册-Math (30)
- JavaScript手册-Number (14)
- JavaScript手册-RegExp (7)
- JavaScript手册-String (38)
- JavaScript手册-全局函数 (8)
- JavaScript实用脚本 (7)
- Others (21)
- java-jpcap (7)
- java-thread (1)
- ibm文章 (3)
- classloader (2)
- java-filter (2)
- 运行环境 (33)
- java-正则 (2)
- oracle (1)
- linux-shell (26)
- wap (1)
- sqlite (3)
- wow (1)
- jvm (1)
- git (5)
- unity3d (29)
- iap (2)
- mysql (23)
- nginx (14)
- tomcat (9)
- apache (2)
- php (1)
- ubuntu (40)
- rsa (1)
- golang (21)
- appstore (5)
- sftp (2)
- log4j (2)
- netty (18)
- 测试工具 (6)
- memcache (5)
- 设计模式 (1)
- centos (8)
- google_iab (5)
- iOS专题 (4)
- mac (10)
- 安装配置帮助手册 (2)
- im4java_graphicsmagick (5)
- inotify-tools (1)
- erlang (6)
- 微信支付 (1)
- redis (8)
- RabbitMQ (5)
最新评论
-
heng123:
Netty视频教程https://www.douban.com ...
netty4.0.23 初学的demo -
maotou1988:
使用Netty进行Android与Server端通信实现文字发 ...
netty4.0.23 初学的demo -
码革裹尸:
非常感谢,正好用上
android 呼入电话的监听(来电监听) -
rigou:
提示的/222.177.4.242 无法链接到ip地址,是什 ...
通过 itms:services://? 在线安装ipa ,跨过app-store -
duwanbo:
GridView与数据绑定
[iPhone开发之控件的使用]UIAlertView的各种属性、方法及代理的使用
转载自:http://blog.csdn.net/banyingli/article/details/6167592
#import "AlertViewTestViewController.h" @implementation AlertViewTestViewController /* Tasks Creating Alert Views – initWithTitle:message:delegate:cancelButtonTitle:otherButtonTitles: Setting Properties delegate property title property message property visible property Configuring Buttons – addButtonWithTitle: numberOfButtons property – buttonTitleAtIndex: cancelButtonIndex property firstOtherButtonIndex property Displaying – show Dismissing – dismissWithClickedButtonIndex:animated: 无例 */ // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { //初始化AlertView UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"AlertViewTest" message:@"message" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OtherBtn",nil]; //设置标题与信息,通常在使用frame初始化AlertView时使用 alert.title = @"AlertViewTitle"; alert.message = @"AlertViewMessage"; //这个属性继承自UIView,当一个视图中有多个AlertView时,可以用这个属性来区分 alert.tag = 0; //只读属性,看AlertView是否可见 NSLog(@"%d",alert.visible); //通过给定标题添加按钮 [alert addButtonWithTitle:@"addButton"]; //按钮总数 NSLog(@"numberOfButtons:%d",alert.numberOfButtons); //获取指定索引的按钮的标题 NSLog(@"buttonTitleAtIndex:%@",[alert buttonTitleAtIndex:2]); //获得取消按钮的索引 NSLog(@"cancelButtonIndex:%d",alert.cancelButtonIndex); //获得第一个其他按钮的索引 NSLog(@"firstOtherButtonIndex:%d",alert.firstOtherButtonIndex); //显示AlertView [alert show]; [alert release]; [super viewDidLoad]; } /* // Override to allow orientations other than the default portrait orientation. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return (interfaceOrientation == UIInterfaceOrientationPortrait); } */ - (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } - (void)viewDidUnload { // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (void)dealloc { [super dealloc]; } #pragma mark -- UIAlertViewDelegate -- //根据被点击按钮的索引处理点击事件 - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { NSLog(@"clickedButtonAtIndex:%d",buttonIndex); } //AlertView已经消失时 - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex { NSLog(@"didDismissWithButtonIndex"); } //AlertView即将消失时 - (void)alertView:(UIAlertView *)alertView willDismissWithButtonIndex:(NSInteger)buttonIndex { NSLog(@"willDismissWithButtonIndex"); } - (void)alertViewCancel:(UIAlertView *)alertView { NSLog(@"alertViewCancel"); } //AlertView已经显示时 - (void)didPresentAlertView:(UIAlertView *)alertView { NSLog(@"didPresentAlertView"); } //AlertView即将显示时 - (void)willPresentAlertView:(UIAlertView *)alertView { NSLog(@"willPresentAlertView"); } @end
发表评论
-
iOS程序运行生命周期
2015-11-10 09:05 954iOS程序运行生命周期 在文件AppDele ... -
iOS开发系列--IOS程序开发概览
2015-11-10 07:32 1170iOS开发系列--IOS程序开发概览 概览 ... -
2015年11月Xcode7.1(7B91b)打包发布苹果iOS应用指南
2015-11-09 18:29 108672015年11月Xcode7.1(7B91b) ... -
self.navigationController pushViewController执行不成功
2015-11-06 08:28 1597self.navigationControlle ... -
ios NSString format 保留小数点 float double
2015-11-05 17:37 2921ios NSString format 保留小数点 f ... -
自定义 URL Scheme 完全指南
2015-11-04 16:21 893自定义 URL Scheme 完全指南 转载 htt ... -
UIViewController生命周期方法viewDidLoad、viewWillAppear和viewDidAppear
2015-11-01 12:29 2942UIViewController生命周期 ... -
关于self.view.window与viewDidLoad、viewWillAppear、viewDidAppear
2015-11-01 09:36 2523关于self.view.window与viewD ... -
UIScreen学习记录
2015-10-31 08:18 1050UIScreen学习记录 转载自 ... -
使用NSTimer和CGAffineTransformMakeRotation实现旋转动画
2015-10-29 11:53 1814使用NSTimer和CGAffineTransform ... -
【原】iOSCoreAnimation动画系列教程(一):CABasicAnimation【包会】
2015-10-29 08:59 1014【原】iOSCoreAnimation动 ... -
iOS 在UILabel显示不同的字体和颜色
2015-10-27 08:07 1547在项目开发中,我们经常会遇到在这样一种情形:在一个UI ... -
UISlider滑动条的属性介绍以及于标签联合使用实时显示变动值
2015-10-27 08:06 1243UISlider滑动条的属性 ... -
关于使用DSLTableView下拉刷新数据遇到的问题
2015-10-23 21:17 932关于使用DSLTableView下 ... -
使用AdSupport.framework生成IDFA唯一标识符
2015-10-23 17:29 4699使用AdSupport.framework生成IDFA ... -
AppDelegate的详解
2015-10-22 17:51 665AppDelegate的详解 ... -
iOS开发问题集锦
2015-10-22 13:06 5151. Xcode开发连真机运行报错Please ver ... -
iOS 对象属性参数名定义的注意事项不能以alloc,new,copy,mutableCopy 作为开头命名
2015-10-21 15:41 1318property's synthesized g ... -
iOS-自定义的画圆或弧的UIView
2015-10-21 14:20 2646iOS-自定义的画圆或弧的UIView Cu ... -
iOS自定义的模态提示对话框
2015-10-20 14:27 6465iOS自定义的模态提示对话框 基本思路: 1.创建 ...
相关推荐
iphone中的基础控件UIAlertView,适合初学者,主要学习UIAlertView的常用属性设置、点击事件、添加其他视图到UIAlertView上等
1.系统的UIAlertView使用方便,但是有时需要三个按钮,这时的UIAlertView会出现问题,三个按钮的默认摆放位置,不尽人意 2.使用UIAlertView的Delegate,来修改其布局
封装体统的UIAlertView,使用Block传递数据。
swift - UIAlertView的使用
这个程序是在iPhone3.1.3的模拟器测试通过的,如果大家需要定制UIAlertView的Table请下载这个程序,有很好的参考价值
一款简单易用的弹窗控件,类似系统的UIAlertView,但是JPAlertView增加了可选框功能,能够满足更多的开发需求!
自定义 UIAlertView
因为iOS8 以后UIAlertView已经不推荐使用 所以自己简单封装了一下UIAlertView 和 UIAlertController 根据系统自动选择 封装的比较简单 为了方便使用而已
UIAlertView 的替代品
一个简单的封装UIalertView,可以达到展示列表的目的
UIAlertView自动消失,原文地址:http://blog.csdn.net/u010962810/article/details/21245785
UIAlertView左对齐 UIAlertView左对齐
作者paozi-jun,源码YYAlertView,Swift 语言编写自定义控件, 实现一个自定义的UIAlertView 。
UIAlertView例子 包括最基础的,和按钮事件,以及带文本输入的Alert
当用户将要进行的操作具有一定危险时,常常使用Action Sheet对用户进行危险提示,这样,用户有机会进行取消操作。 Alert相当于Windows中的Messagebox,跟Action Sheet也是类似的。不同的是,Alert可以只有一个选择项...
UIAlertView,UIActionSheet,UIAlertController封装,一句代码即可,iOS任何系统都可以使用 软件开发设计:PHP、QT、应用软件开发、系统软件开发、移动应用开发、网站开发C++、Java、python、web、C#等语言的项目...
https://github.com/STShenZhaoliang/STAlertView 400行写的自定义UIAlertView,没有开太多接口,大家可以自由修改。
UIAlertView左对齐且居中显示,兼容>ios7,添加该两个文件,直接调用方法[alertView setTextAlignmentLeft];则可