Showing posts with label UIButton. Show all posts
Showing posts with label UIButton. Show all posts

Saturday, 15 February 2014

How to change the background color of UIView with delay/animation: Xcode/cocos2d

We can change the background color of an UIView with delay as follows. This can be also used for many other UIElement animations such as changing the properties of an UIButton (such as textColor) with delay/animation.


 [UIView animateWithDuration:2.0 animations:^{
    [myView setBackgroundColor:[UIColor grayColor]];
 }
    

Tuesday, 24 December 2013

How to set an image at the left corner of an UIButton

Let button Frame is:

  myButton.frame = CGRectMake(008030);

            
To set an image at the left corner of an UIButton, do as follows:

  [myButton setImageEdgeInsets:UIEdgeInsetsMake(030080)];