Android: Sub-class Gallery doesn't scroll by onKeyDown event

和自甴很熟 提交于 2019-12-23 13:17:07

问题


I have a sub-classed Gallery widget which I customized its onFling method, otherwise everything should be the same as the original Gallery widget.

And I am trying to animate its scrolling left or right by using:

gallery.onKeyDown(KeyEvent.KEYCODE_DPAD_LEFT, new KeyEvent(0, 0));

But that doesn't seems to work on the sub-class Gallery. Any idea why?


回答1:


If you guys have this problem, try get rid of the gallery spacing value -- that solved it for me.



来源:https://stackoverflow.com/questions/4801700/android-sub-class-gallery-doesnt-scroll-by-onkeydown-event

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!