NSArray *array=[NSArray arrayWithObjects:@"亚洲",@"欧洲",@"美国",nil];
UISegmentedControl *seg=[[UISegmentedControl alloc]initWithItems:array];
seg.frame=CGRectMake(30, 100, 300, 50);
//修改颜色
seg.tintColor=[UIColor yellowColor];
//默认选中下标
seg.selectedSegmentIndex=1;
//添加点击事件
[seg addTarget:self action:@selector(selectWitch) forControlEvents:UIControlEventValueChanged];
[self.view addSubview:seg];
ios中分段控件的使用
最新推荐文章于 2020-08-08 10:48:47 发布
899

被折叠的 条评论
为什么被折叠?



