ios - How to set background image for disabled segment in UISegmentedControl -


i've tried set color disabled segment in uisegmentedcontrol. not yet succeeded. want know if it's possible set background image disabled segment in uisegmentedcontrol.

i've tried following code it's not working :

nsdictionary *attrs = @{ uitextattributetextcolor : [uicolor lightgraycolor] }; [self.controlstatus settitletextattributes:attrs forstate:uicontrolstatedisabled];  [self.controlstatus setbackgroundimage:[[uiimage imagenamed:@"img.png"] retain] forstate:uicontrolstatedisabled barmetrics:nil]; 

1st 2 lines working. i'm able set color not background image or background color when disabled.

is there way ??

uisegmentcontrol has divider between 2 segments. using following code can change divider background.

[segmentedctrl setdividerimage:[uiimage imagenamed:@"divider_selected.png"] forleftsegmentstate:uicontrolstateselected rightsegmentstate:uicontrolstatenormal barmetrics:uibarmetricsdefault]; [segmentedctrl setdividerimage:[uiimage imagenamed:@"divider_normal.png"] forleftsegmentstate:uicontrolstatenormal rightsegmentstate:uicontrolstatenormal barmetrics:uibarmetricsdefault]; 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -