YIem`s Blog -心比天高命比纸薄-链接找不到的请在站内搜索内容！ - 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];