注:
android:scrollbars="none"//隐藏滚动条
1、垂直超出显示:
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<Button
android:text="登录"
android:id="@+id/Button1"
android:layout_width="75dip"
android:layout_height="40dip"
></Button>
<Button
android:text="登录"
android:id="@+id/Button2"
android:layout_width="75dip"
android:layout_height="40dip"
></Button>
//此处可以摆放N个控件,当超出范围时会有垂直滚动条
</LinearLayout>
</ScrollView>
2、水平超出显示
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="none">//隐藏滚动条
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<Button
android:id="@+id/button1"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:text="1"/>
<Button
android:id="@+id/button2"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:text="2"/>
//此处可以摆放N个控件,当超出范围时会有垂直滚动条
</LinearLayout>
</HorizontalScrollView>