2017-01-07 2 views
1

私のプロジェクトはUISegmentControllerです。私は灰色のセパレータを持っている。 Segment ControllerUISegmentControllerの区切り文字の色を変更しますか?

黒い線の間にセパレータがありますが、白いセパレータがありますが、灰色のセパレータが必要ですか?いくつかのコードを提案してください。 私のコードは、あなたが画像を使用して、それを設定する必要が

- (void)changeColor{ 

    [[UISegmentedControl appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor colorWithRed:83.0f/255.0f green:198.0f/255.0f blue:255.0f/255.0f alpha:1.0]} forState:UIControlStateSelected]; 

    [[UISegmentedControl appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor colorWithRed:197.0f/255.0f green:197.0f/255.0f blue:197.0f/255.0f alpha:1.0]} forState:UIControlStateNormal]; 

} 

答えて

関連する問題