[問題] ios5以下,中文切換keyboard擋到..

看板MacDev作者 (iOS5)時間13年前 (2012/06/13 20:53), 編輯推噓3(305)
留言8則, 3人參與, 最新討論串1/1
公司專案是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

06/13 22:47, , 1F
UIKeyboardWillShowNotification +
06/13 22:47, 1F

06/13 22:47, , 2F
userInfo valueForKey:UIKeyboardFrameEndUserInfoKey
06/13 22:47, 2F

06/14 00:20, , 3F
我是想監聽切換成中文後keyboard的frame
06/14 00:20, 3F

06/14 00:20, , 4F
UIKeyboardWillShowNotification只有監聽keyboard show
06/14 00:20, 4F

06/14 01:41, , 5F
你試了嗎,那個Notification會在每次換輸入法都觸發喔
06/14 01:41, 5F

06/14 02:45, , 6F
推樓上,UIKeyboardWillShowNotification好用github有實作
06/14 02:45, 6F

06/14 10:04, , 7F
剛試了..果然有效,一直都有效嗎?..XD..還以為show鍵盤
06/14 10:04, 7F

06/14 10:04, , 8F
才會觸發
06/14 10:04, 8F
文章代碼(AID): #1Fs8rSmv (MacDev)