0
我有一个自定义视图,我设法使用这个帖子启用滚动条:Android: Enable Scrollbars on Canvas-Based View。 问题是我无法滚动它们,即使我覆盖了计算功能。 下面是创建视图代码:自定义视图滚动条
而这里的视图的构造函数:
super(context);
setBackgroundResource(android.R.color.white);
setHorizontalScrollBarEnabled(true);
setVerticalScrollBarEnabled(true);
TypedArray styledAttributes=context.obtainStyledAttributes(
R.styleable.View);
initializeScrollbars(styledAttributes);
styledAttributes.recycle();
和:
@Override public int computeHorizontalScrollRange() { return 2000; }
@Override public int computeVerticalScrollRange() { return 2000; }
正如我所说的,我看到滚动条,但滚动不起作用。 感谢您的帮助。