UISegmentedControl的具体使用】的更多相关文章

UISegmentedControl *segmentedControl = [[UISegmentedControl alloc] initWithItems:nil]; segmentedControl.tintColor = [UIColor orangeColor]; //渲染色彩 [segmentedControl insertSegmentWithTitle:@"专家介绍"atIndex:0 animated:NO]; [segmentedControl insertSeg…
一.初始化 二.常见的属性 1.segmentedControlStyle属性:设置基本的样式 2.momentary属性:设置在点击后是否恢复原样 . 3.numberOfSegments属性:只读,获取总选项数. 4.apportionsSegmentWidthsByContent属性:设置是否根据segment的内容改变segment的宽度,默认为NO,宽度相同. 5.selectedSegmentIndex属性:设置选中第几个segment,一般用于初始化时选中. 6.tintColor…
@implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; NSArray* segmentArray = [[NSArray alloc]initWithObjects:@"Title1", @"Title2", @"Title3",nil]; //也可以通过insertSegmentWithtitile方法添加选项 //也可以对某个选项选择添加图片 UIS…
- (void)viewDidLoad {    [super viewDidLoad];    NSArray *items = @[@"消息", @"电话"];    UISegmentedControl *segment = [[UISegmentedControl alloc] initWithItems:items];    segment.frame = CGRectMake(40, 100, 295, 30);    // 添加一个新的Item到seg…
/** 设置选择器 */ - (void)setUpSegmentCtr { UISegmentedControl *segmentCtr = [[UISegmentedControl alloc] initWithItems:@[@"采购订单",@"销售订单"]]; self.navigationItem.titleView = segmentCtr; [segmentCtr addTarget:self action:@selector(didClicksegm…
UISegmentedControl:分栏控件,常用的属性和方法是 1.tintColor:控制分栏控件的颜色风格 2.insertSegmentWithTitle(Image):插入分栏标题(图片) UIStepper:步进器,常用来控制数字的加减,常用的属性: 1.maximumValue:步进器支持的最大值 2.minimumValue:步进器支持的最小值 3.value:步进器的当前值 4.stepValue:步进器每一步的递进值 5.continous:是否支持长按时连续触发回调函数…
一.创建 UISegmentedControl* mySegmentedControl = [[UISegmentedControl alloc]initWithItems:nil]; 是不是很奇怪没有指定位置和大小呢?没错,我确实在他的类声明里只找到 initWithItems 而未找到 initWithFrame ,所以他不需要指定,不过我看到了另一个方法,这个方法可以设置Item的宽度: mySegmentedControl setWidth: forSegmentAtIndex:];//…
//UIActivityIndicatorView //小菊花,加载 #import "ActivityIndicatorVC.h" @interface ActivityIndicatorVC (){ UIActivityIndicatorView *_activity ; } @end @implementation ActivityIndicatorVC -(void)viewDidLoad{ [super viewDidLoad]; [self createActivityIn…
效果图 当你点击上面人物名字的时候 ,就可以随意切换人物. 这个很有趣 , 你还可以试着添加音乐播放器 .以及一些别的来完善你想做的. 好吧 , 废话不多说 , 上代码. #import "ViewController.h" @interface ViewController () @property(strong,nonatomic) UISegmentedControl * mysegment; @property(strong,nonatomic) UIImageView *my…
基础小控件 /***************************************UIlabel*************************************/ UILabel *label = [[UILabel alloc]init];//创建UIlabel对象 label.frame = CGRectMake(50, 50, 100, 50);//设定label的位置与大小 label.backgroundColor = [UIColoryellowColor];//…