[英]Scrolling Android ScrollView to X-axis and Y-axis
在我的Android應用程序中,我想使用ScrollView ,它必須可以滾動到X軸和Y軸 。 不使用ScrollView和HorizontalScrollView,因為我無法使用一個ScrollView並啟用兩個滾動。 我在下面做了什么。
<ScrollView
android:id="@+id/srv1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/ll1" >
<HorizontalScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:id="@+id/linearMain"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:animateLayoutChanges="true"
android:orientation="vertical" >
</LinearLayout>
</HorizontalScrollView>
</ScrollView>
是否可以只使用一個滾動視圖並啟用兩個滾動。 謝謝!!
AFAIK,編號ScrollView用於垂直滾動,ListView也是如此。 HorizontalScrollView僅用於水平滾動。 要實現x和y軸滾動,必須同時使用ScrollView和HorizontalScrollView。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.