For some icons and other buttons under the art Design button can be stretched effect to deal with the desired effect, the most familiar than the oval background chat, but also through this principle of background image.
How do I stretch the picture? First find the part to be stretched, it is obvious that the two sides of the ellipse is constant to stretch is the middle section, how to specify the middle part, first look at
Specifying these 4 widths will result in a black module. This is the piece of content that is constantly filling the middle of the stretch.
Specific code:
1uiimage* img=[uiimage imagenamed:@"2.png"];//Original2Uiedgeinsets Edge=uiedgeinsetsmake (0,Ten,0,Ten);3 //Uiimageresizingmodestretch: Stretch mode to fill a picture by stretching the rectangular area specified by the Uiedgeinsets4 //Uiimageresizingmodetile: Tile mode, fills the map by repeating the uiedgeinsets specified rectangular area5img=[img Resizableimagewithcapinsets:edge resizingmode:uiimageresizingmodestretch];6self.imageview.image=img;
Post-stretch effect:
IOS Picture Stretching tips