Customizing the colors of a UISegmentedControl

后端 未结 12 1850
萌比男神i
萌比男神i 2020-12-08 07:26

Does anybody know of a way to customize the appearance of the string based UISegmentedControl? I am trying to set the background color of the cell and the text color differe

12条回答
  •  情话喂你
    2020-12-08 08:20

    As of iOS13, you would be no longer able to modify the tint color of the segment controller. Need to use selectedSegmentTintColor if the color has to be customised. self.yourSegmentControl.selectedSegmentTintColor = UIColor(red: 240.0/255.0, green: 183.0/255.0, blue: 0.0/255.0, alpha: 1.0)

提交回复
热议问题