Monday, May 5, 2014

android GridView prohibited item to get focus, seeking big cow!


Recently made a set-top box applications, demand is horizontal scroll two rows of data;
My solution is:
HorizontalScrollView + GridView, but if you use the focus control scrolling, it must prohibit the item gets the focus, so to gridview set myGridView.setDescendantFocusability (ViewGroup.FOCUS_AFTER_DESCENDANTS);
But there is a problem after scrolling when scrolling to the end, the focus away from gridview then came in, the focus will jump directly to each item in the first, but not into the nearest item, what is the reason?
Been tested, regardless of whether there are sets of rolling out GridView control, even if it is a separate GridView, as long as the set myGridView.setDescendantFocusability (ViewGroup.FOCUS_AFTER_DESCENDANTS);
So the focus away from the GridView, then come all the direct jump to the first item inside, rather than entering from outside Button recent item.
Solving! How to solve this problem?
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->

No comments:

Post a Comment