推荐一个button 弹起pickerview的源码,也可以作为工具类使用。
利用inputview 做键盘弹起动画。该如何做呢?
1.继承uiview
2.重写属性&方法
1
2
3
4
5
6
7
8
9
10
|
@property (readwrite) uiview *inputview;
@property (readwrite) uiview *inputaccessoryview;
- ( bool )isuserinteractionenabled
{
return yes;
}
- ( bool )canbecomefirstresponder
{
return yes;
}
|
3.添加tapgesture
1
2
3
4
|
uitapgesturerecognizer *tap = [[uitapgesturerecognizer alloc] initwithtarget:self action:@selector(touchaction)];
[tap setnumberoftouchesrequired:1];
[tap setnumberoftapsrequired:1];
[self addgesturerecognizer:tap];
|
4.实现方法touchaction
以上所述是小编给大家介绍的ios中利用inputview 弹出 picker,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对服务器之家网站的支持!
原文链接:http://blog.csdn.net/cluy_/article/details/53761820