关于segmentControl不同状态不同颜色的设置

今天做这样的样式的,时候,发现他的border也会和background重叠在一起,非常不好看,于是我选择重新设置他的border,使得他的颜色不会重叠在一起。做好之后如下效果:

 

关于segmentControl不同状态不同颜色的设置

    [self setBorderAndColor:self.payBuddySegmentControl];

-(void)setBorderAndColor:(UIView *)bgView{

    

    bgView.layer.cornerRadius = kButtonCornerRadius;

    bgView.clipsToBounds = YES;

    //border

    bgView.layer.borderWidth = 1.0f;

    bgView.layer.borderColor = [UIColor whiteColor].CGColor;

}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-03
  • 2021-11-16
  • 2022-12-23
  • 2022-12-23
  • 2021-09-29
  • 2022-12-23
猜你喜欢
  • 2021-09-04
  • 2022-12-23
  • 2021-07-15
  • 2022-12-23
  • 2022-12-23
  • 2021-08-28
  • 2022-12-23
相关资源
相似解决方案