因此,我有一个水平滚动视图,我想尝试添加一个抓取效果,这基本上是一个元素的中心。到目前为止,我已经用XML完成了所有这些工作。
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:scrollbars="none" >然后我在里面有一个LinearLayout。那么,我如何在LinearLayout快照中创建元素呢?另外,是否有办法使布局从中间元素开始?因此,当你看到滚轮,你可以滚动左或右从一开始。如果能帮忙的话,我会很感激的!谢谢你们!
发布于 2013-03-24 04:29:36
为什么不使用查看寻呼机(http://developer.android.com/reference/android/support/v4/view/ViewPager.html)?但是,如果您坚持使用水平滚动视图,那么有一些教程可以如下所示
-http://www.dev-smart.com/archives/34 -http://blog.velir.com/index.php/2010/11/17/android-snapping-horizontal-scroll/ -http://androidprogrammingmadeeasy.blogspot.com/2011/08/creating-custom-horizontal-scroll-view.html
https://stackoverflow.com/questions/15595059
复制相似问题