不要让按钮焦点最初在触摸模式 [英] Don't let button focus initially in touch mode
问题描述
我有一个布局,其中作为活动被启动(如果在触摸模式)的第一个按钮不断尽快敛焦点。有没有一种方法来礼貌地询问了活动,不支持自动对焦?我知道我可以把一个聚焦的虚拟布局0宽度/高度要做到这一点,似乎应该有更好的东西。
参考:在Android应用程序 设置初始焦点p>
感谢
我有这个问题了。我周围有通过设置可聚焦和focusableInTouchMode属性为true父的LinearLayout。
机器人:可聚焦=真
机器人:focusableInTouchMode =真
I have a layout in which the first button keeps grabbing focus as soon as the activity is started (if in touch mode). Is there a way to politely ask the activity to not auto-focus? I know I can put in a focusable dummy layout with 0 width/height to do this, seems like there should be something better.
Reference: Set initial focus in an android application
Thanks
I had this problem too. I got around it by setting the focusable and focusableInTouchMode attributes to true in the parent LinearLayout.
android:focusable="true"
android:focusableInTouchMode="true"
这篇关于不要让按钮焦点最初在触摸模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!