Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
318 views
in Technique[技术] by (71.8m points)

ios - Change Label of UISwitch

I have to change the label of a UISwitch from ON-OFF to YES-NO.

I want this method to be implemented in separate class and then accessed by other classes.

I have tried to implement the snippets provided in the cook book, but without success

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

you can use images for on and off

@property(nonatomic, retain) UIImage *offImage;
@property(nonatomic, retain) UIImage *onImage;

image size is of 77*27


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.9k users

...