I have setup a button like this:
// Create facebook login button
facebookLoginButton = [[UIButton alloc] initWithFrame:CGRectMake(10, 20, 300,50)];
facebookL
Since you are setting the frame of the button explicitly, and since you are creating your own image, you do not need a resizable image. Your button is 300 by 50 so make a 300 by 50 image (along with a 600 by 100 image for a double-resolution device) and set the background image of the button to it.
However, I'll also give a code example. For the image that you actually give, if you name it FacebookLogin@2x.png so that it is used as the double-resolution image, the value you want to use is resizableImageWithCapInsets:UIEdgeInsetsMake(0,50,0,50)
. Here is the result:
I wrote a script to generate the resizable image with cap insets. Very useful. https://github.com/kejinlu/capimage