ios - UIImage's resizableImageWithCapInsets places a shadow on image -
I'm having trouble updating a Where are these PNGs I Now, when I execute this code, I get a strange shadow on the split control, which is what we do not want Are there. It is as if the output looks like which is very strange, because no one Shadow is not original images, nor does Looking forward, I saw that if I say Any thoughts? Because I'm really crazy on this, since I do not need this problem when using Thanks a lot I thought it. Frames of fractured controller height is 44, and background images were 75ptsx75pts. Since I set the top and bottom of the image up to 18pts, the OS was taking 18pts above and below the image pointing to the rest of the image and changing its shape. Here's a fun part, because the image has a gradient, the remaining image is ignored and the control is color that is there. To use images with vertical shield, you get a base PNG with your exact equal height as your control () This is what I did, the image of 44x44 Resized and changed the insets to UISegmentedControl : I've subclassed it I set it I am canceling both selected states and such a selection background for the state:
#define kEdgeInsets UIEdgeInsetsMake (18, 18, 18, 18) UIImage * grayImage = [[UIImage v_imageNamed: @ "gray_rect"] resizableImageWithCapInsets: kEdgeInsets]; [Self setbackground image: State for Gray Image: UICOutrolStateOther Barmatrix: UIBarMetricsDefault]; UIImage * greenImage = [[UIImage v_image named: @ "green_rect"] resizableImageWithCapInsets: kEdgeInsets]; [Self setbackground image: State for green image: UIContolstate selected barometrics: UIBarMetricsDefault]; [Self Settinterler: [UIColor colorWithRed: 0.506 green: 0.514 blue: 0.525 alpha: 1.000]];
UISegmentedControl add one (as far as I know).
resizableImageWithCapInsets: , the image looks distorted (as one should expect), but without shadows.
resizableImageWithCapInsets:
UIButton
UIEdgeInsetsMake (0, 10, 0, 10) indicates that the image does not change in vertical size
Comments
Post a Comment