How can I change UIButton title color?

Ads
 

How can I change UIButton title color?

Hi,

I have a button in my iPhone/iPad application. I want to change the color of the text when user clicks on it making it selected.

Provide me good example code.

Thanks

View Answers

January 2, 2011 at 2:30 PM

Hi,

You have to set the color of the button for a particular state say: forSelected.

Use the following code:

[myButtonsetTitleColor:[UIColor redColor] forState:UIControlStateNormal];

Thanks


January 2, 2011 at 2:31 PM

Hi,

There is space between myButton setTitleColor.

Here is corrected code:

[myButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];

Thanks

Ads









Related Tutorials/Questions & Answers:
How can I change UIButton title color?
What is the default session time in php and how can I change it?
Advertisements
I want to change my user name on your website ,how can i do this
How can i Change Button Label Value Randomly in VIRTUAL KEYBOARD using JAVA or Net Beans ???
How can i Change Button Label Value Randomly in VIRTUAL KEYBOARD using JAVA or Net Beans ???
Change panel height, width and title
How do I change a large string into hex and then into byte so that SHA1 can be applied to it?
UIButton setTitle forState
How to print UIButton id
can i change the logo of the web site on the fly - JSP-Servlet
UIButton Image Change
How can I do it? .click();
How can I learn Java?
iPhone Change Button Text
how should i can solve
how can i add hibernate plugin to eclipse?
how i can get jqfade.js library
How to send UIWebView Title to UINavigationBar
how can i make monthly register ?
how can i remove newline characters and tabs
UIButton
how can i create a discussion forum?
How can I to my database to my application
how can i display a editable result of form?
how can i display a pdf file in a jtextarea
How can I protect my database password ?
How can i modify my account in roseindia
How can I create sessionfactory in Hibernate?
How can i use Facebook connect button
how can i close a frame. - Java Beginners
How can I show users privileges in MySQL?

Ads