【发布时间】:2014-03-17 16:39:22
【问题描述】:
当我在代码中使用 Scrollview 时,我的背景图像会通过按钮进行拉伸和滚动。我只想要按钮滚动,而不是背景。我附上了一张相关的图片,你可以弄清楚。 这是 XML 文件:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/back"
android:orientation="vertical" >
<ImageButton
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/app"
android:layout_gravity="center"
android:background="@drawable/bluebutton"
android:layout_marginTop="80dp"
android:layout_marginRight="80dp"
android:layout_marginLeft="80dp"
/>
<ImageButton
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/moshiri"
android:background="@drawable/bluebutton"
android:layout_marginTop="8dp"
android:layout_marginRight="80dp"
android:layout_marginLeft="80dp"
/>
<ImageButton
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/about"
android:background="@drawable/bluebutton"
android:layout_marginTop="8dp"
android:layout_marginRight="80dp"
android:layout_marginLeft="80dp"
/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/exit"
android:background="@drawable/bluebutton"
android:layout_marginTop="8dp"
android:layout_marginRight="80dp"
android:layout_marginLeft="80dp"
/>
</LinearLayout>
</ScrollView>
【问题讨论】:
标签: android layout scrollview