简体   繁体   English

我想在android中创建一个“捕捉”水平scoll视图,一次将自身固定在特定视图中

[英]I want to create a “snapping” horizontal scoll view in android which fixes itself at a particular view at a time

What we call "snapping" horizontal scroll view. 我们称之为“捕捉”水平滚动视图。 For example the default android calculator app whose a set of keys are fixed on screen unless user swipes it away to get another set. 例如,默认的android计算器应用程序,其一组键固定在屏幕上,除非用户将其滑开以获得另一组键。 How do I achieve this kind of scrolling? 如何实现这种滚动? I used simple HorizontalScrollView widget for the purpose, but it's not what I want.![enter image description here][1] 我为此目的使用了简单的Horizo​​ntalScrollView小部件,但这不是我想要的。![在此处输入图像描述] [1]

You can achieve this using a ViewPager layout - the same layout you would use to achieve a tabbed user interface. 您可以使用ViewPager布局实现此目的-与用于实现选项卡式用户界面的布局相同。

The documentation for ViewPager is available here: http://developer.android.com/reference/android/support/v4/view/ViewPager.html ViewPager的文档可在以下位置找到: http : //developer.android.com/reference/android/support/v4/view/ViewPager.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM