gpt4 book ai didi

ios7 - uisegmentedcontrol 边框颜色

转载 作者:行者123 更新时间:2023-12-04 04:33:21 27 4
gpt4 key购买 nike

我在 iOS7 中更改分段控件的边框颜色时遇到问题。我在 stackoverflow 的其他地方找到了以下建议:

    [[UISegmentedControl appearance] setTitleTextAttributes:@{
UITextAttributeTextColor: [UIColor colorWithRed:255.0/255.0 green:255.0/255.0 blue:255.0/255.0 alpha:1.0],
UITextAttributeTextShadowColor: [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0],
UITextAttributeFont: [UIFont fontWithName:@"Arial-Bold" size:0.0],
NSForegroundColorAttributeName : [UIColor redColor],

} forState:UIControlStateSelected];

[self.segmentedControl setTitleTextAttributes:@{
UITextAttributeTextColor: [UIColor colorWithRed:255.0/255.0 green:255.0/255.0 blue:255.0/255.0 alpha:1.0],
UITextAttributeTextShadowColor: [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0],
UITextAttributeFont: [UIFont fontWithName:@"Arial-Bold" size:0.0],
NSForegroundColorAttributeName : [UIColor redColor],

} forState:UIControlStateNormal];

但在这两种情况下,我的边框仍然是蓝色。我似乎无法通过 settitleTextAttributes 更改字体阴影、边框颜色或其他任何内容。

如何调整边框颜色?

最佳答案

[segmentControlObj setTintColor:[UIColor redColor]];

关于ios7 - uisegmentedcontrol 边框颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20180002/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com