问题描述:

I am doing a customized keyboard. How to make those keyboard of letter button(A-Z) bigger while touching?

网友答案:

Look at the button's events. There're UIControlEventTouchDown, UIControlEventTouchUpInside and some others. You should assign IBActions to those events.

But if you have many buttons you'd better subclass UIButton and override it's touchesBegan:, touchesMoved: and touchesEnded: messages.

In these messages resize your button's frame according to your needs (you could even change it's background image or text size). But make sure superview of your buttons doesn't have Clips Subviews attribute set.

相关阅读:
Top