作者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
推 dreambird:UIKeyboardWillShowNotification + 06/13 22:47
→ dreambird:userInfo valueForKey:UIKeyboardFrameEndUserInfoKey 06/13 22:47
→ shinrenpan:我是想監聽切換成中文後keyboard的frame 06/14 00:20
→ shinrenpan:UIKeyboardWillShowNotification只有監聽keyboard show 06/14 00:20
推 dreambird:你試了嗎,那個Notification會在每次換輸入法都觸發喔 06/14 01:41
推 Spake:推樓上,UIKeyboardWillShowNotification好用github有實作 06/14 02:45
→ shinrenpan:剛試了..果然有效,一直都有效嗎?..XD..還以為show鍵盤 06/14 10:04
→ shinrenpan:才會觸發 06/14 10:04