Home » IOS » Add color to label, button, background using hexa code in IOS Application
IOS

Add color to label, button, background using hexa code in IOS Application

Add color to the text field, labels, background, button text etc using the hexa color code as like in html.

Place the following function in the current viewController.m file

Now call the function from the .m file to assign a color with the color code

Now it will create a white color with the given hexa code.

To set the background color of the current view, Add the below code in the viewDidLoad function the .m file

Now the background will be black in color.

Similarly change background color of button. see below

Now the button background will be white in color.

Similarly change text color of button. see below

Now button text is white in color.

About the author

Vipin

Hi, i am Vipin, a programmer working in Dubai, UAE. I love blogging, and so started TechRounder for sharing my findings and other digital informations with others too. Please feel free to share your feedback with me in the comment section below or you can email me at vipin@techrounder.com.

2 Comments

Click here to post a comment

Your email address will not be published. Required fields are marked *

Get latest updates
in your inbox

Subscribe to TechRounder mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.