KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm allocating a UIButtonTypeCustom to a UIView with a background image that is smaller than the button's frame. Reason why the image is smaller is because I'm trying to add more of a "target area" for the UIButton. However, the image is being scaled to the full size of the frame, rather than just being the image's size. I have tried setting the UIButton and UIButton's imageView's contentMode property to UIViewContentModeScaleAspectFit , but no luck, the image still gets stretched out. Is there a way to do what I'm trying to do programmatically? Thanks in advance!
Tags (comma-separated)
Save Edits
Cancel