0
私のセグメント化されたコントロールに絵文字を入れたいのであれば、おそらく最初の行にイメージを取得したいのですが、2番目と3番目になります。UISegmentedControlで絵文字を消すのを防ぐ方法
私はそれをどのように修正することができますか?
私のセグメント化されたコントロールに絵文字を入れたいのであれば、おそらく最初の行にイメージを取得したいのですが、2番目と3番目になります。UISegmentedControlで絵文字を消すのを防ぐ方法
私はそれをどのように修正することができますか?
ちょうどUIControlStateSelected状態のためのテキスト属性として@{NSForegroundColorAttributeName : [UIColor whiteColor]}
を置く
@interface ViewController()
@property (weak, nonatomic) IBOutlet UISegmentedControl *segmentedControl;
@end
@implementation ViewController
- (void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
NSDictionary *dict = @{NSForegroundColorAttributeName : [UIColor whiteColor]};
[self.segmentedControl setTitleTextAttributes:dict forState:UIControlStateSelected];
}
@end