How to customize UISwitch button in iphone?

后端 未结 2 608
无人及你
无人及你 2020-11-29 08:49

I created a UISwitch using this code...

UISwitch *switch = [[UISwitch alloc]initWithFrame:CGRectMake(110, 230, 60, 60)];
[window addSubview:switchView];
[swi         


        
2条回答
  •  野性不改
    2020-11-29 09:26

    I used this solution: UICustomSwitch: it works customizing a UISlider and setting a max valure of 1.

    You can change the images of your switch, the right / left text and use it with a unique color on background (if you don't want to use images).

    The only change I did was about the name: UI is reserved for Apple classe, so I changed it for my own.

提交回复
热议问题