iphone - Adding Background image to UILabel -


How can I add a background image to a UILabel in an iPhone app? I tried to do it through IB but no results.

Can someone help me ..

Your answer is moving forward.

Try it with code:

Objective- C:

  theLabel.backgroundColor = [UIColor colorWithPatternImage: [UIImage imageNamed: @ "Blah"]];  

Swift:

  thelabel.backgroundColor = UIColor (Pattern Image: UIImage (named: "blah")! )  

or a UIImageView behind the label (not recommended).


Update: Keeping a UIImageView behind a label was not recommended because you have to manage two ideas. But if you have to do something which only a UIImageView can do it is still a good way, I doubt that your app will actually move like this better.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -