Search code examples
iphoneobjective-cuibuttonuicolor

changing the colour of Button


how can I change the button colour when ever I click that button please help me out


Solution

  • In the action which is executed, when you click the button just add the following line:

    button.backgroundColor = [UIColor randomColor];
    

    This gives the button a random color everytime you click it. ;-)