当前位置: 动力学知识库 > 问答 > 编程问答 >

ios - How to make button keyboard(A-Z) bigger while touching like iphone keyboard

问题描述:

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.

分享给朋友:
您可能感兴趣的文章:
随机阅读: