A UIButton has 3 different image properties:
currentBackgroundImage
currentImage
imageView
What do each of them represent?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I would say that a
UIButtonhas two sets of images:those assigned through:
setImage:forState:those assigned through
setBackgroundImage:forState:They allow you to set foreground and background images for the allowed states to a button:
UIControlStateNormal,UIControlStateHighlighted,UIControlStateDisabled,UIControlStateSelected, etc. (they are described in the doc you link to, under section "Control State".)Now,
currentBackgroundImageandcurrentImageallow direct access to the current image (i.e., the image corresponding to the current state of the button).On the other hand,
imageViewallows to have access to theUIImageViewobject underlying the button image, so that you can set its properties, if needed. E.g. (from the doc you link):