/ Published in: Objective C
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
UISegmentedControl *segmentedControl = [[UISegmentedControl alloc] initWithItems:itemArray]; segmentedControl.frame = CGRectMake(40, 5, self.view.frame.size.width - 80, 30); segmentedControl.segmentedControlStyle = UISegmentedControlStyleBezeled; segmentedControl.tintColor = [UIColor blackColor]; segmentedControl.selectedSegmentIndex = 0; [segmentedControl addTarget:self action:@selector(segmentedControlValueChanged:) forControlEvents:UIControlEventValueChanged]; [self.view addSubview:segmentedControl]; [segmentedControl release];