scrollview 的各类代理方法汇总
来源:互联网 发布:鳄鱼有耳朵吗 知乎 编辑:程序博客网 时间:2024/05/21 11:16
- 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
0 0
- scrollview 的各类代理方法汇总
- scrollview的代理方法
- scrollview的一些代理方法
- scrollview的一些代理方法
- scrollview的一些代理方法
- ScrollView的代理方法 scrollViewDidEndDecelerating和scrollViewDidEndDragging
- textView的代理方法汇总
- Swift中ScrollView缩放图片的代理方法
- 184,ScrollView中常用的属性与代理方法
- ScrollView嵌套ListView方法汇总
- IOS学习 scrollView的代理
- ScrollView常用属性及代理方法
- ScrollView 代理
- 由apple sample code "LazyTableImages"谈谈scrollView的两个代理方法
- 汇总:各类手游渠道特点及选择方法
- ScrollView等控件的代理协议
- C#中各类获取设备存储信息的各类方法
- 【问题汇总】ScrollView嵌套ListView的问题
- SkipList数据结构学习
- eclispe 远程调试 Tomcat 下项目代码问题
- 深入理解Java:SimpleDateFormat安全的时间格式化
- JSSDK,微信JS接口,分享朋友圈狀態捕獲,項目實例
- Java网络编程(一):服务端与客户端建立(UDP方式)
- scrollview 的各类代理方法汇总
- android 手机的网络时间同步
- java学习3-冒泡排序对数组进行排序
- Crashlytics 教程
- ERROR: ORA-00600: 内部错误代码, 参数: [17182], [0x2AE72343B77C], [], [], [], [], [], []
- getActivity()返回null的解决问题
- imageView的.setBackgroundResource 、setBackground没有效果
- [渗透测试] 工具简介
- iOS--持续存储-简介