Yes, you can display an image and a title in the same button, as long as they are both small enough to fit. The hard part comes, when you need to deal with placement.
You can play with the
contentHorizontalAlignment properties of the
UIButton (inherited from
You can also use the
imageEdgeInsets properties to shift the the title and image from the placement they get based on the alignment properties.
If you want very accurate or custom placement, I suggest overriding the
imageRectForContentRect: methods of the
UIButton. These allow you to define the frames for your title and image, and they are called whenever the button needs to be laid out. One warning, if you want to reference
self.titleLabel inside of
titleRectForContentRect:, make sure
self.currentTitle is defined first. I was getting a bad access error, , possibly the method is called when first initializing the titleLabel.