问题
I am customizing my UIButton and I can either set image or background image. They both work fine but how do I decide which one to use? Are these two methods for when people have image that are broken up into foreground and background so they can layer them?
回答1:
The background image is scaled to fill the bounds of the UIButton, and is displayed behind the title. The foreground image is not scaled, and displayed next to the button title.
So if you want to put a title on your button, use the background image.
回答2:
The background image serves for you to customize the "button image", the common background that all your buttons will take. The button image itself will lay on top of the background image and you can use to add, e.g., a small icon to further decorate the contents of the button.
来源:https://stackoverflow.com/questions/1309977/uibutton-image-and-background-image-which-one-to-use-for-custom-image