Android Horizo​​ntalScrollView 捕捉

标签 android scroll element center horizontalscrollview

所以我有一个水平 ScrollView ,我想尝试添加捕捉效果,基本上使元素居中。 到目前为止我基本上都是用 XML 完成的。

<HorizontalScrollView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:scrollbars="none" >

然后我里面有一个 LinearLayout 。 那么我该如何让 LinearLayout 内的元素对齐呢?另外,有没有办法让布局从中间元素开始?因此,当您看到滚动条时,您可以从一开始就向左或向右滚动。 将不胜感激任何帮助!谢谢大家!

最佳答案

关于Android Horizo​​ntalScrollView 捕捉,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15595059/

相关文章:

java - 将 Activity 堆栈清除到顶部

android - android 的 Canvas 滚动背景

javascript - AngularJS 获取元素进入 View

Javascript用鼠标缓慢滚动到页面上的下一个 anchor

list - 从 For 语句向 Flutter 中的列表添加元素?

android - react native : In-app developer menu android (genymotion)

android - IntentService 不会显示 Toast

java - Kotlin : Passing HashMap with multiple value types into function

Jquery 拖拽 : Removing an element changes position of other dropped elements

Jquery - 如何使用类和属性查找元素