[英]Changing the location of a UIButton when it is clicked
I'm putting together an app that uses a keyboard (like the native iPhone one) that has symbols on the keys. 我正在整理一个使用键盘的应用程序(例如本机iPhone键盘),该键盘的按键上带有符号。 My question is how to I change the location of a button when it is clicked (as the UIControlStateHighlighted images is bigger than the regular state). 我的问题是如何在单击按钮时更改按钮的位置(因为UIControlStateHighlighted图像大于常规状态)。
Thanks for any help/pointers. 感谢您的帮助/指针。
Try this: 尝试这个:
[yourView setFrame:CGRectMake(yourHorizontalPosition,yourVerticalPosition,[yourView.frame.size width],[yourView.frame.size height])];
Does that work for you? 那对你有用吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.