以下のように、iOS5 で利用可能な新しいメソッドでカスタマイズした iPad アプリに UISegmentedControl があります。
[[UISegmentedControl appearance] setBackgroundImage:segmentUnselected forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
[[UISegmentedControl appearance] setBackgroundImage:segmentSelected forState:UIControlStateSelected barMetrics:UIBarMetricsDefault];
[[UISegmentedControl appearance] setDividerImage:segmentUnselectedUnselected forLeftSegmentState:UIControlStateNormal rightSegmentState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
[[UISegmentedControl appearance] setDividerImage:segmentSelectedUnselected forLeftSegmentState:UIControlStateSelected rightSegmentState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
[[UISegmentedControl appearance] setDividerImage:segUnselectedSelected forLeftSegmentState:UIControlStateNormal rightSegmentState:UIControlStateSelected barMetrics:UIBarMetricsDefault];
NSDictionary *textAttributes = [NSDictionary dictionaryWithObjectsAndKeys:[UIFont systemFontOfSize:17], UITextAttributeFont,
[UIColor colorWithRed:0.3 green:0.34 blue:0.42 alpha:1], UITextAttributeTextColor,
[UIColor whiteColor], UITextAttributeTextShadowColor,
CGSizeMake(0, 1), UITextAttributeTextShadowOffset, nil];
[[UISegmentedControl appearance] setTitleTextAttributes:textAttributes forState:UIControlStateNormal];
見た目は問題なく動作しますが、どのセグメントでも setEnabled:NO を呼び出しても効果がないという問題があります。セグメントは引き続きタッチ イベントに応答します。一部のセグメントを無効にするために何をする必要があるか知っている人はいますか?