用法:android
self.segment_title = [[UISegmentedControl alloc] initWithItems:segmentTextContent]; self.segment_title.frame = CGRectMake(0, 0, 300, 30); self.segment_title.selectedSegmentIndex = 0; self.segment_title.autoresizingMask = UIViewAutoresizingFlexibleWidth; self.segment_title.segmentedControlStyle = UISegmentedControlStyleBar;//不起做用 [self.segment_title addTarget:self action:@selector(segmentAction:) forControlEvents:UIControlEventValueChanged];
這貨用法太簡單了。 android裏RadioGroup 還要設置點擊效果,去除選中效果等。code