随笔分类 - iOS控件
摘要://时间间隔 NSTimeInterval activeTimeInterval = NETWORK_SEND_ACTIVE_TIME; NSTimeInterval otherTimeInterval = NETWORK_SEND_OTHERS_TIME; //定时器 NSTimer *mianTimer; mianTimer = [NSTimersched...
阅读全文
摘要:UIButton的代码实现:定义: UIButton * switchButton;创建: switchButton = [UIButtonbuttonWithType:UIButtonTypeRoundedRect];添加到屏幕上: [primaryView addSubview:switchButton];修改属性的方法: //Button的位置和大小 CGRec...
阅读全文
摘要:UIImage就是一个储存图片的变量,其它控件需要显示图片时都要先通过UIImage才能获取到图片,所以它是连接图片和控件的中转站。构造方法: UIImage * tempImage = [UIImage imageNamed:IMAGE_NAME];常用方法: //UIImage自带方法:(readonly) CGSize imageSize =[tempImage size]...
阅读全文
摘要:UIImageView是一个用于显示图片的控件构造方法: UIImage * tempImage = [UIImage imageNamed:IMAGE_NAME]; imageView = [[UIImageView alloc] initWithImage:tempImage];常用方法: imageView.frame = [self fitScreenFrameWithH...
阅读全文
摘要:UISlider是一个用来调节的滑块,可以通过滑块来设置程序的某些属性构造方法: imgSlider= [[UISlideralloc]initWithFrame:sliderRect];常用方法: //设置响应事件和委托 [imgSlideraddTarget:selfaction:@selector(updateSliderValue:) forControlEvent...
阅读全文
摘要:UILabel 就是一个显示文字的控件,可以设置文字的各种属性。构造方法: //通过设置Label的边框来初始化UILabel labelOfSlider = [[UILabelalloc] initWithFrame:CGRectMake(LABELSLIDER_X, LABELSLIDER_Y, LABELSLIDER_LENGTH, LABELSLIDER_HEIGHT)];常用...
阅读全文
摘要:UITableView是一个用于显示列表的视图,可以作为子视图镶嵌在主视图上,可以滑动,选取各种参数定义:@interface ViewController : UIViewController{@property (nonatomic, retain) NSArray *dataList;@property (nonatomic, retain) UITableView *myTableView...
阅读全文
摘要:UIAlertView是用于弹出一个对话框进行选择或者消息提示构造函数: UIAlertView * alert = [[UIAlertViewalloc] initWithTitle:@"提示~"message:@"保存成功" delegate:selfcancelButtonTitle:@"Ok"otherButtonTitles:nil, nil];常用方法: //显示Alert...
阅读全文