YIem`s Blog -心比天高命比纸薄-链接找不到的请在站内搜索内容！ - uisegmentedcontrol
type: channel
link: https://www.yiem.net/tag/uisegmentedcontrol/
items: iOS-UI-UISegmentedControl-分段控制器

iOS-UI-UISegmentedControl-分段控制器
type: item
date: 2016-01-18T19:18:00+08:00
description: 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];