1

i want to create a horizontal scroll view just like the one shown in imagehorizontal scroll view

In android widgets i found Horizontal Scroll View widget in composite section but dont know how to use it.Please help

4

1 回答 1

2

首先创建xml file并添加,HorizontalScrollView然后将一个布局作为子项添加到此。然后你可以添加任何没有。对新添加的孩子的看法,这使得整个事情scroll

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >
    <HorizontalScrollView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" >
        <RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" >
            <!--  child views here -->
        </RelativeLayout>
    </HorizontalScrollView>
</LinearLayout>
于 2012-10-05T06:35:52.290 回答