我确定你知道谷歌播放,我有超过5个标签的标签栏。 所以它是可滚动的(水平),但我需要以编程方式滚动它只是20dp,以便用户在看到它时会立即注意到滚动功能。
有一个简单的方法吗?
I'm sure you know Google Play, I have tab bar with more than 5 tabs. So it's scrollable (horizontally), but i need to scroll it programatically just for 20dp so that the user will notice the scroll function as soon as he/she sees it.
is there an easy way to do that?
最满意答案
我认为这正是您正在寻找的: http : //developer.android.com/reference/android/widget/ScrollView.html#smoothScrollTo%28int,%20int%29
当您使用水平滚动时,您必须指定要移动的“x”轴。 只需调整它直到你认为它没问题。
I think this is exactly what you're looking for: http://developer.android.com/reference/android/widget/ScrollView.html#smoothScrollTo%28int,%20int%29
As you're using a Horizontal scrolling, you have to specify the 'x' axis to move. Just tune it until you think it's ok.
更多推荐
发布评论