Reputation: 825
I have a problem with ScrollView
- it is focusable
. I'm writing a simple app that controled from DPAD. Layout has only ScrollView (empty for now) and a button under it. I don't know why, but ScrollView
is focusable
and I can not turn it off. focusable
and focusableInTouchMode
set to false
not work at all. Activity automatically gives it focus on start. I do not access ScrollView from any part of code, only button. What can it be? Thanks in advance.
Upvotes: 2
Views: 1269
Reputation: 11
It is not a bug. In the ScrollView
constructor, there is initScrollView()
, and in the method, there is setFocusable(true)
. It is initiated when the app make ScrollView
instance.
Upvotes: 1
Reputation: 825
I think there is a bug in android. ScrollView
is focusable
by default and focusable
can not be set in layout xml
, but I called setFocusable(false)
on ScrollView
after findViewById
and it works now. Mayby bug in latest support library (I'm using version 25.1.0).
Upvotes: 6