gpt4 book ai didi

android - 可聚焦和可聚焦InTouchMode之间的区别?

转载 作者:IT老高 更新时间:2023-10-28 13:13:39 24 4
gpt4 key购买 nike

我想知道它们之间的实际区别......什么时候应该使用,应该如何使用,在哪些情况下有帮助?

举几个例子,详细解释一下。

最佳答案

在 Android 开发者博客中有解释:http://android-developers.blogspot.co.at/2008/12/touch-mode.html

下面的引号应该清楚:

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;

...

In touch mode, there is no focus and no selection. Any selected item in a list of in a grid becomes unselected as soon as the user enters touch mode. Similarly, any focused widgets become unfocused when the user enters touch mode.

...

Now that you know focus doesn't exist in touch mode, I must explain that it's not entirely true. Focus can exist in touch mode but in a very special way we call focusable in touch mode. This special mode was created for widgets that receive text input, like EditText or, when filtering is enabled, ListView.

...

Focusable in touch mode is a property that you can set yourself either from code or XML. However, it should be used sparingly and only in very specific situations as it breaks consistency with Android normal behavior. A game is a good example of an application that can make good use of the focusable in touch mode property. MapView, if used in fullscreen as in Google Maps, is another good example of where you can use focusable in touch mode correctly.

关于android - 可聚焦和可聚焦InTouchMode之间的区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24155956/

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