Return to Snippet

Revision: 51483
at September 26, 2011 19:08 by paki


Initial Code
NSArray *itemArray = [NSArray arrayWithObjects: @"Monthly", @"Yearly", @"Overview", nil];
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];

Initial URL

                                

Initial Description

                                

Initial Title
Simple UISegmentedControl Initialization

Initial Tags

                                

Initial Language
Objective C