![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
iOS控件
笔者的锋芒
欢迎iOS、swift以及各种it知识的交流。。。
展开
-
UILabel
1、创建UILabel *label = [[UILabel alloc] init];2、设置大小label.frame = CGRectMake(0, 100, 100, 20);3、设置背景颜色label.backgroundColor = [UIColor yellowColor];4、设置文字label.text = @"设置UILabel的文字";5、设置文字颜色label.textCo原创 2015-03-04 16:17:42 · 544 阅读 · 0 评论 -
UITextView
UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(10, 30, 300, 200)]; textView.delegate = self; textView.tag = 1; //是否滚动 textView.scrollEnabled = YES; textView.font =原创 2015-03-05 15:40:35 · 452 阅读 · 0 评论 -
UISegmentedControl 分段控制器
//设置分段内容 NSArray *title = @[@"分组", @"全部"]; UIImage *image1 = [UIImage imageNamed:@"reload_30"]; UIImage *image2 = [UIImage imageNamed:@"rotate_30"]; NSArray *title2 = @[image1, image2, @原创 2015-03-05 15:21:35 · 782 阅读 · 0 评论 -
UIActivityIndicatorView
//活动指示视图UIActivityIndicatorView *flower1 = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];//活动指示圈UIActivityIndicatorView *activityIndicator = [[UIAc原创 2015-03-05 15:01:53 · 820 阅读 · 0 评论 -
UITextField
1、创建UITextField *textField = [[UITextField alloc] init];2、位置和大小textField.frame = CGRectMake(100, 100, 200, 30);3、背景颜色textField.backgroundColor = [UIColor yellowColor];4、提示语textField.placeholder = @"这是提原创 2015-03-05 14:40:13 · 527 阅读 · 0 评论 -
UISwitch 开关
UISwitch *swt = [[UISwitch alloc] initWithFrame:CGRectMake(0, 30, 100, 50)]; UIImage *on = [UIImage imageNamed:@"smiley_grin_30"]; UIImage *off = [UIImage imageNamed:@"smiley_sad_30"]; //设置o原创 2015-03-05 15:35:45 · 547 阅读 · 0 评论 -
UIStepper 计步器
UIStepper *stepper = [[UIStepper alloc] initWithFrame:CGRectMake(10, 30, 100, 50)]; //设置最大值最小值 stepper.maximumValue = 10000; stepper.minimumValue = 1000;// stepper.autorepeat = NO; //设原创 2015-03-05 15:31:31 · 960 阅读 · 0 评论 -
UIImageView
1、创建UIImageView *imageView = [[UIImageView alloc] init];2、大小和位置imageView.frame = CGRectMake(100, 100, 60, 60);3、添加图片imageView.image = [UIImage imageNamed:@"1.jpg"];4、设置内容模式/* UIViewContentModeScal原创 2015-03-05 11:03:14 · 482 阅读 · 0 评论 -
UIButton
1、创建/* UIButtonTypeCustom = 0, // no button type UIButtonTypeSystem NS_ENUM_AVAILABLE_IOS(7_0), // standard system button UIButtonTypeDetailDisclosure, UIBut原创 2015-03-04 17:25:49 · 587 阅读 · 0 评论 -
UITouch id<UIResponder>
UIImageView *_imageView; _imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 30, 100, 100)]; UIImage *image = [UIImage imageNamed:@"agent_40"]; _imageView.image = image;//手指触碰到屏幕的时候触发原创 2015-03-05 15:47:36 · 589 阅读 · 0 评论 -
UISlider 滑动条
//滑块 音量设置,播放进度 UISlider *slider = [[UISlider alloc] initWithFrame:CGRectMake(0, 30, 300, 50)]; //滑块左边的颜色 slider.minimumTrackTintColor = [UIColor redColor]; //滑块右边的颜色 slider.maximumT原创 2015-03-05 15:23:42 · 795 阅读 · 0 评论 -
UIProgressView 进度条
//进度条--主要用在下载等需要进度显示的地方UIProgressView *progressView = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleDefault];progressView.frame = CGRectMake(10, 40, 300, 30);progressView.tag =原创 2015-03-05 15:09:11 · 661 阅读 · 0 评论 -
UINavigationController及页面跳转、push
//定义一个视图控制器// let vc = ViewController(nibName:nil,bundle: nil) let vc = ViewController() //创建导航控制器 let nvc = UINavigationController(rootViewController:vc) //设置根视原创 2015-03-10 14:42:08 · 2301 阅读 · 0 评论