Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIButton image and background image, which one to use for custom image?

Tags:

uikit

iphone

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?

like image 688
Boon Avatar asked Aug 21 '09 03:08

Boon


2 Answers

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.

like image 63
Tobias Klüpfel Avatar answered Oct 06 '22 02:10

Tobias Klüpfel


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.

like image 31
fbrereto Avatar answered Oct 06 '22 04:10

fbrereto