开发者

custom button with multiple images

开发者 https://www.devze.com 2023-01-12 19:14 出处:网络
i have 3 images that i would like to use them to generate my custom button. my images are left.png 5x20, right.png 5x20 and mid.png 1x20. my mid.png must be repeated as long as my text lenght. how can

i have 3 images that i would like to use them to generate my custom button. my images are left.png 5x20, right.png 5x20 and mid.png 1x20. my mid.png must be repeated as long as my text lenght. how can i gener开发者_如何学Pythonate it in iphone application on the fly?

thanks.


Look at the leftCapWidth property on UIImage. You need to combine the images into a single PNG file, and then tell it the pixel width of the left part using that property. Then when that UIImage is drawn, it'll resize correctly.

0

精彩评论

暂无评论...
验证码 换一张
取 消