V
V
Vanya Ivanov2014-03-30 18:15:11
Objective-C
Vanya Ivanov, 2014-03-30 18:15:11

How to make button text change on click, Objective-c?

When you click on the button, you need to change its text.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Rifat, 2014-03-31
@mr_cloud

link

S
Sashke, 2014-03-30
@Sashke

- (void)buttonClicked{
[email protected]"Новый текст";
}

P
Pavel, 2014-04-06
@NightSoul

The button has states, for each of them you can set your own text
[button setTitle:@"highlighted and selected" forState: UIControlStateHighlighted ];
[button setTitle:@"Highlighted only" forState: UIControlStateHighlighted ];
[button setTitle:@"Selected only" forState: UIControlStateSelected ];
[button setTitle:@"Normal" forState: UIControlStateNormal ];
You can also set a background for each state. This is a very trivial question, to which there are a lot of answers on the Internet.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question