作者shinrenpan (iOS5)
看板MacDev
标题[问题] ios5以下,中文切换keyboard挡到..
时间Wed Jun 13 20:53:45 2012
公司专案是support ios4.3
在ios5以後
UIKeyboardWillChangeFrameNotification
UIKeyboardDidChangeFrameNotification
可以监听keyboard frame改变
但ios5之前怎办呢?
使用[[UITextInputMode currentInputMode]primaryLanguage]
不管是中文输入, 还是手写输入都是回传zh-hant
不能判别keyboard上方是否有选字方块
目前只找到private api可以用
http://hi.baidu.com/yunhuaikong/item/25abf910fd1d81071994ec2f
另外一个方法就是用for去找windows 的subview
有更好的方法吗?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 118.233.115.167
1F:推 dreambird:UIKeyboardWillShowNotification + 06/13 22:47
2F:→ dreambird:userInfo valueForKey:UIKeyboardFrameEndUserInfoKey 06/13 22:47
3F:→ shinrenpan:我是想监听切换成中文後keyboard的frame 06/14 00:20
4F:→ shinrenpan:UIKeyboardWillShowNotification只有监听keyboard show 06/14 00:20
5F:推 dreambird:你试了吗,那个Notification会在每次换输入法都触发喔 06/14 01:41
6F:推 Spake:推楼上,UIKeyboardWillShowNotification好用github有实作 06/14 02:45
7F:→ shinrenpan:刚试了..果然有效,一直都有效吗?..XD..还以为show键盘 06/14 10:04
8F:→ shinrenpan:才会触发 06/14 10:04