iOS-UI-UISegmentedControl-分段控制器

UISegmentedControl-分段控制器
self.seg = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObjects:@"界面1", @"界面2", @"界面3", nil]];
self.seg.frame = CGRectMake(100, 100, 200, 30);
// 起始选中状态
self.seg.selectedSegmentIndex = 0;
// 注意触发方式
[self.seg addTarget:self action:@selector(segAction:) forControlEvents:UIControlEventValueChanged];
[self.view addSubview:self.seg];
[self.seg release];
屏幕快照 2016-01-18 下午7.17.32.png

标签: uisegmentedcontrol

添加新评论

Title - Artist
0:00