segment文字颜色,选中颜色,未选中颜色设置

//改变segment相关颜色的设置方法,对于系统默认颜色不满足的可以参考以下代码进行修改啦。
    self.segmentC.tintColor = YJ_COLOR(0xd3e6f7);
    self.segmentC.backgroundColor = [UIColor whiteColor];
    self.segmentC.layer.borderColor = [UIColor blueColor].CGColor;
    self.segmentC.layer.borderWidth = 0.5;
    self.segmentC.layer.cornerRadius = 3;
    NSDictionary * selectedTextAttr = @{NSFontAttributeName:[UIFont systemFontOfSize:16],NSForegroundColorAttributeName:[UIColor blueColor]};
    [self.segmentC setTitleTextAttributes:selectedTextAttr forState:UIControlStateSelected];
    NSDictionary * unselectedTextAttr = @{NSFontAttributeName:[UIFont systemFontOfSize:16],NSForegroundColorAttributeName:[UIColor blueColor]};
    [self.segmentC setTitleTextAttributes:unselectedTextAttr forState:UIControlStateNormal];

你可能感兴趣的:(ios,segment,选中颜色,文字颜色,未选中颜色)