We can stretch the image using the code below: - Here we need m..m to be the same size, so we stretch the middle part
UIImage *image = [UIImage imageNamed:@"img_loginButton.png"]; UIEdgeInsets edgeInsets; edgeInsets.left = 3.0f; //Assume it is the pixel for starting 'm' edgeInsets.top = 0.0f; edgeInsets.right = 3.0f; //Assume it is the pixel for Ending 'm' edgeInsets.bottom = 0.0f; image = [image resizableImageWithCapInsets:edgeInsets]; //Use this image as your controls image
source share