How to move focus smothly between different icons in GridView
There will be a highlight focus if you focus one icon or one image in the gridview. Topically, the highlight color is orange in emulator 2.3, green in honeycomb, and blue in GoogleTV.开发者_如何学Go But that doesn't matter. You can use
GridView.setSelector(frame)
GridView.setDrawSelectorOnTop(true)
to change it. But the highlight focus is static. If you debug on the GoogleTV, you will find that the GoogleTV's highlight background move smoothly when you move from one icon to another.I search the ViewSwitcher, find that it is defined for changing different screen, or different view. ViewFlipper is for different activities. Does anyone know how to animate the slide in and out between different icons or images?
I search a lot, still can't get any idea about how to do it. Thanks anybody who can help me.
The way this is done is by having a separate view in your app which is just the selector. Then there is a stub Drawable class which is used as the selector of the GridView. This stub class has a reference to the other view, and when the bounds are set, it animates the view to the bounds of the stub using ViewAnimator classes.
精彩评论