简体   繁体   中英

Enlarge button while reducing button's image?

I have a small image button which fits nicely in a certain area of my screen.

The image is a perfect size for viewing, but too small to tap.

Is there any way to make the button itself bigger (hence easier to tap), but make the image smaller, so it looks the right size?

You just use UIView as a touchView under the your small button. Like this,

在此处输入图片说明

In this case, I put UIView under the small heart button. And, I implement tap action by UITapGesture.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM