When the provided picture is 100 wide and the content is 200 wide, the content will be displayed beyond the length of the picture.
directly on the solution.
_reservelabel . text = @ "1234567890 " ;
Get the label content length
cgsize reservelabelsize = [_reservelabelsizethatfits:cgsizemake(maxfloat ,+)];
Reset the label frame
_reservelabel. frame =CGRectMake(ten,0, reservelabelsize. Width,+);
// Place the background image on the image
UIImage *image = [UIImageimagenamed:@ "Biao1"];
Select the position of the Extrude (PS: with parentheses)
image = [Image stretchableimagewithleftcapwidth:(2)topcapheight:( 0 )];
Reset the ImageView frame
_reserveimageview. frame =cgrectmake(0, COOKIMAGEVIEWH- _reservelabel. Width + +, +);
Set the image of the ImageView
_reserveimageview. Image = image;
IOS stretches ImageView length based on label length