Search code examples
objective-cxcodeios4uibutton

how to make button round with image background in IPhone?


I have a round button, but i will make it have a backgroud with image.

but when i do it, by setting the (what) property to an image, the button becomes rectangle because the image is a rectangle. How do I keep the button round?


Solution

  • Simply by doing this

    #import <QuartzCore/QuartzCore.h>
    myButton.layer.cornerRadius = 8;