Saturday, 2 November 2019

tvos UISegmentedControl focus style not change

I want to change background color of UISegmentedControl when it highlighted in tvOS.

Normally Segment display like following.
enter image description here

When change focus for change selected segment at that time display like following.
enter image description here

How to change white background when UISegmentedControl focused?

I was try following things but not working.

1) create custom class of UISegmentedControl and do following code in awakeFromNib

[self setBackgroundImage:image forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
[self setBackgroundImage:image forState:UIControlStateFocused barMetrics:UIBarMetricsDefault];

2) override setHighlighted method of UISegmentedControl

3) change background color in didUpdateFocusInContext method.



from tvos UISegmentedControl focus style not change

No comments:

Post a Comment