gpt4 book ai didi

android - XML 属性用法 "android:focusableInTouchMode"

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:54:12 29 4
gpt4 key购买 nike

请告诉我为什么使用以下 XML 属性?我查阅了 developer.android.com 上的文档,但什么也看不懂。

android:focusableInTouchMode

最佳答案

This blog post可以帮助您理解触摸模式的含义。

最相关的部分:

The touch mode is a state of the view hierarchy that depends solely on the user interaction with the phone. By itself, the touch mode is something very easy to understand as it simply indicates whether the last user interaction was performed with the touch screen. For example, if you are using a G1 phone, selecting a widget with the trackball will take you out of touch mode; however, if you touch a button on the screen with your finger, you will enter touch mode. When the user is not in touch mode, we talk about the trackball mode, navigation mode or keyboard navigation, so do not be surprised if you encounter these terms. Finally, there is only one API directly related to touch mode, View.isInTouchMode().

所以android:focusableInTouchMode="true" 意味着当手机处于触摸模式时 View 可以获得焦点。

通常,EditText 通常在触摸模式下可聚焦,而另一方面,Button 通常在触摸模式下不可聚焦。

关于android - XML 属性用法 "android:focusableInTouchMode",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24685144/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com