Android的:子类库不通过onKeyDown事件滚动 [英] Android: Sub-class Gallery doesn't scroll by onKeyDown event

查看:104
本文介绍了Android的:子类库不通过onKeyDown事件滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个子类图库部件,我定制了onFling方法,否则一切都应该是一样的原始画廊部件。

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?

推荐答案

如果你们有这个问题,尝试摆脱画廊间距值的 - 这解决了我

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

这篇关于Android的:子类库不通过onKeyDown事件滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆