iOS AssistiveTouch slow animation when using custom keyboard

邮差的信 提交于 2019-12-10 13:11:58

问题


I'm building an custom keyboard, everything is fine now, except when i'm using AssistiveTouch during my custom keyboard is enabled, the animation of AssistiveTouch is little bit laggy (slow zoom in , zoom out) when tap to open it.

I tested on iPhone 4s and iPhone 6 , same trouble, so i think is not about device hardware or resource consume.

Anyone having same trouble or know reason? and how to solve it ?


回答1:


I found reason by myself. that because of shadow. i added shadow for each button, after remove shadow, the lag didn't appear anymore.

so anyone suggest some better way to add shadow to button without laggy?

this is my way to add shadow to button:

button.layer.masksToBounds = false
        button.layer.shadowColor = UIColor(rgb: 0x000000, alpha: 0.5).CGColor
        button.layer.shadowOpacity = 1.0
        button.layer.shadowRadius = 0
        button.layer.shadowOffset = CGSizeMake(0, 1.0)



回答2:


I found the answer to this after a little time of trying. I found that really you have to add shadow to your buttons. if you are using Xcode 6 or 7 then when you go to your storyboard, select the button and select the attribute inspector and there will be a option of shadow. select it and you will get it.



来源:https://stackoverflow.com/questions/27172911/ios-assistivetouch-slow-animation-when-using-custom-keyboard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!