UIControl控件对象

UIControl 是所有具有事件处理控件的父类。

控件主要响应事件:

基于触摸的事件,

基于值的事件,

基于编译的事件。

常用事件:点击事件、进度条拖动.

UIControl常用方法

-(void)addTarget:(id)target action:(SEL)action forControlEvents:(UIControlEvents)controlEvents;

-(void)removeTarget:(id)target action:(SEL)action  forControlEvents:(UIControlEvents)controlEvents;

-(NSSet *)allTargets;

-(UIControlEvents)allControlEvents;

-(NSArray *)actionsForTarget:(id)target forControlEvent:(UIControlEvents)controlEvent;

-(void)sendAction:(SEL)action to:(id)target forEvent:(UIEvent *)event;

-(void)sendActionsForControlEvents:(UIControlEvents)controlEvents;

 

UISlider滑块

UISlider的常用属性

value             //滑块的值

minimumValue           //滑块最小值

maximumValue          //滑块最大值

 

分段控件

UISegmentedControl分段控件

属性:

segmentedControlStyle                //显示样式

selectedSegmentlndex                 //选择的索引

tintColor                                     //背景颜色

 

UIActivityIndicatorView

activityindicatorViewStyle                //显示样式

方法

-(void)startAnimating;

-(void)stopAnimating;

 

UIAlertView

//初始化

UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"标题"

                                                                       message:@"提示文本信息"

                                                                       delegate:self

                                                           cancelButtonTitle:@"取消"                                                                   

                                                           otherButtonTitles:@"确定",nil];           

[alertView   show];

[alertView   release];

// 代理方法<UIAlertViewDelegate>

//点击按钮所调用的协议方法(通过buttonIndex可以知道我们点击的是哪一个按钮)

-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex;

//alertView 取消调用的协议方法

-(void)alertViewCancel:(UIAlertView *)alertView;

 

//UIActionSheet初始化

UIActionSheet *actionSheet = [[UIActionSheet alloc]

                                          initWithTitle:@"标题"

                                               delegate:self

                                  cancelButtonTitle:@"取消"

                           destructiveButtonTitle:@"确定"

                                  otherButtonTitles:@"选择",nil]; 

[actionSheet   showInView:sele.view];

按钮点击代理方法<UIActionSheetDelegate>

//点击按钮所调用的协议方法(通过buttonIndex可以知道我们点击的是哪一个按钮)

-(void)actionSheet:(UIActionSheet *)actionSheet  clickedButtonAtIndex:(NSInteger)buttonIndex;

//actionSheetView取消调用的协议方法

-(void)actionSheetCancel:(UIActionSheet *)actionSheet;

 

posted @ 2016-03-24 22:44  陈年瑞雪  阅读(104)  评论(0)    收藏  举报