简体   繁体   中英

How to change background image of the UIButton in Interface Builder and preserve its shape?

I'm in the process of writing my first Hello World application for iOS, and I don't know even elementary things, so I'm sorry if this question will be stupid. I want to change the background image of button. But when I do this button changes its shape and becomes squared instead of Rect Square (with non-zero corner radius). So the question are there some ways to change background and preserve button's shape either directly by Interface Builder or by manipulating XML-like language in .xib files or whatever other way.

Add a button and set its type property to custom. With this method you could define an image for the button as you would like it to be displayed not just the background within the rounded rect.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM