How to auto-stretch UISegmented Control horizontally to fill full UITableViewCell? In a manner in which it will auto-resize after an orientation change too.
I have tried the following however this still doesn't work. The segmented control appears in the cell on the left, but does not stretch itself across horizontally.
NSArray *itemArray = [NSArray arrayWithObjects: @"Feet", @"Metric", nil];
UISegmentedControl *segmentedControl = [[UISegmentedControl alloc] initWithItems:itemArray];
segmentedControl.selectedSegmentIndex = [self.config.isMetric boolValue] ? 1 : 0;
segmentedControl.contentMode = UIViewContentModeScaleToFill;
[cell.contentView addSubview:segmentedControl];
cell.contentView.contentMode = UIViewContentModeScaleToFill;
[segmentedControl release];