android - 使第一个按钮固定在 ScrollView 上

标签 android xml android-layout android-emulator

我需要先将按钮固定在屏幕上,因为它就像应用程序 Logo 。我更改了 ScrollView,但随后出现“ ScrollView 只能有一个 subview ”之类的错误。

下面是xml文件

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res/com.apperspray.scarface"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/bg1"
android:orientation="vertical" >

<ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/scrollview1"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <LinearLayout
        android:id="@+id/home_layout"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="#000000"
        android:orientation="vertical" >

        <Button
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/masthead"
            android:layout_width="fill_parent"
            android:layout_height="80dp"
            android:background="@drawable/mastbg"
            android:gravity="left|center" >
        </Button>

        <Button
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/button01"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/buttonbg"
            android:gravity="left|center"
            android:padding="10dp"
            android:shadowColor="#f5f5f5"
            android:shadowDx="1"
            android:shadowDy="1"
            android:shadowRadius="1"
            android:textColor="#6c6c6c"
            android:textSize="10pt" >
        </Button>

        <Button
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/button02"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/buttonbg"
            android:gravity="left|center"
            android:padding="10dp"
            android:shadowColor="#f5f5f5"
            android:shadowDx="1"
            android:shadowDy="1"
            android:shadowRadius="1"
            android:textColor="#6c6c6c"
            android:textSize="10pt" >
        </Button>

        <Button
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/button03"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/buttonbg"
            android:gravity="left|center"
            android:padding="10dp"
            android:shadowColor="#f5f5f5"
            android:shadowDx="1"
            android:shadowDy="1"
            android:shadowRadius="1"
            android:textColor="#6c6c6c"
            android:textSize="10pt" >
        </Button>

        <Button
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/button04"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/buttonbg"
            android:gravity="left|center"
            android:padding="10dp"
            android:shadowColor="#f5f5f5"
            android:shadowDx="1"
            android:shadowDy="1"
            android:shadowRadius="1"
            android:textColor="#6c6c6c"
            android:textSize="10pt" >
        </Button>

        <Button
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/button05"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/buttonbg"
            android:gravity="left|center"
            android:padding="10dp"
            android:shadowColor="#f5f5f5"
            android:shadowDx="1"
            android:shadowDy="1"
            android:shadowRadius="1"
            android:textColor="#6c6c6c"
            android:textSize="10pt" >
        </Button>

        <Button
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/button06"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/buttonbg"
            android:gravity="left|center"
            android:padding="10dp"
            android:shadowColor="#f5f5f5"
            android:shadowDx="1"
            android:shadowDy="1"
            android:shadowRadius="1"
            android:textColor="#6c6c6c"
            android:textSize="10pt" >
        </Button>

        <Button
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/button07"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/buttonbg"
            android:gravity="left|center"
            android:padding="10dp"
            android:shadowColor="#f5f5f5"
            android:shadowDx="1"
            android:shadowDy="1"
            android:shadowRadius="1"
            android:textColor="#6c6c6c"
            android:textSize="10pt" >
        </Button>

        <Button
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/button08"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/buttonbg"
            android:gravity="left|center"
            android:padding="10dp"
            android:shadowColor="#f5f5f5"
            android:shadowDx="1"
            android:shadowDy="1"
            android:shadowRadius="1"
            android:textColor="#6c6c6c"
            android:textSize="10pt" >
        </Button>

        <Button
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/button09"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/buttonbg"
            android:gravity="left|center"
            android:padding="10dp"
            android:shadowColor="#f5f5f5"
            android:shadowDx="1"
            android:shadowDy="1"
            android:shadowRadius="1"
            android:textColor="#6c6c6c"
            android:textSize="10pt" >
        </Button>

        <Button
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/button10"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/buttonbg"
            android:gravity="left|center"
            android:padding="10dp"
            android:shadowColor="#f5f5f5"
            android:shadowDx="1"
            android:shadowDy="1"
            android:shadowRadius="1"
            android:textColor="#6c6c6c"
            android:textSize="10pt" >
        </Button>

        <Button
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/button11"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/buttonbg"
            android:gravity="left|center"
            android:padding="10dp"
            android:shadowColor="#f5f5f5"
            android:shadowDx="1"
            android:shadowDy="1"
            android:shadowRadius="1"
            android:textColor="#6c6c6c"
            android:textSize="10pt" >
        </Button>

        <Button
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/button12"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/buttonbg"
            android:gravity="left|center"
            android:padding="10dp"
            android:shadowColor="#f5f5f5"
            android:shadowDx="1"
            android:shadowDy="1"
            android:shadowRadius="1"
            android:textColor="#6c6c6c"
            android:textSize="10pt" >
        </Button>

        <Button
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/button13"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/buttonbg"
            android:gravity="left|center"
            android:padding="10dp"
            android:shadowColor="#f5f5f5"
            android:shadowDx="1"
            android:shadowDy="1"
            android:shadowRadius="1"
            android:textColor="#6c6c6c"
            android:textSize="10pt" >
        </Button>

        <Button
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/button14"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/buttonbg"
            android:gravity="left|center"
            android:padding="10dp"
            android:shadowColor="#f5f5f5"
            android:shadowDx="1"
            android:shadowDy="1"
            android:shadowRadius="1"
            android:textColor="#6c6c6c"
            android:textSize="10pt" >
        </Button>

        <Button
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/button15"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/buttonbg"
            android:gravity="left|center"
            android:padding="10dp"
            android:shadowColor="#f5f5f5"
            android:shadowDx="1"
            android:shadowDy="1"
            android:shadowRadius="1"
            android:textColor="#6c6c6c"
            android:textSize="10pt" >
        </Button>

        <Button
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/button16"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/buttonbg"
            android:gravity="left|center"
            android:padding="10dp"
            android:shadowColor="#f5f5f5"
            android:shadowDx="1"
            android:shadowDy="1"
            android:shadowRadius="1"
            android:textColor="#6c6c6c"
            android:textSize="10pt" >
        </Button>

        <Button
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/button17"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/buttonbg"
            android:gravity="left|center"
            android:padding="10dp"
            android:shadowColor="#f5f5f5"
            android:shadowDx="1"
            android:shadowDy="1"
            android:shadowRadius="1"
            android:textColor="#6c6c6c"
            android:textSize="10pt" >
        </Button>

        <Button
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/button18"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/buttonbg"
            android:gravity="left|center"
            android:padding="10dp"
            android:shadowColor="#f5f5f5"
            android:shadowDx="1"
            android:shadowDy="1"
            android:shadowRadius="1"
            android:textColor="#6c6c6c"
            android:textSize="10pt" >
        </Button>

        <Button
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/button19"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/buttonbg"
            android:gravity="left|center"
            android:padding="10dp"
            android:shadowColor="#f5f5f5"
            android:shadowDx="1"
            android:shadowDy="1"
            android:shadowRadius="1"
            android:textColor="#6c6c6c"
            android:textSize="10pt" >
        </Button>

        <Button
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/button20"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/buttonbg"
            android:gravity="left|center"
            android:padding="10dp"
            android:shadowColor="#f5f5f5"
            android:shadowDx="1"
            android:shadowDy="1"
            android:shadowRadius="1"
            android:textColor="#6c6c6c"
            android:textSize="10pt" >
        </Button>

        <Button
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/button21"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/buttonbg"
            android:gravity="left|center"
            android:padding="10dp"
            android:shadowColor="#f5f5f5"
            android:shadowDx="1"
            android:shadowDy="1"
            android:shadowRadius="1"
            android:textColor="#6c6c6c"
            android:textSize="10pt" >
        </Button>

        <Button
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/button22"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/buttonbg"
            android:gravity="left|center"
            android:padding="10dp"
            android:shadowColor="#f5f5f5"
            android:shadowDx="1"
            android:shadowDy="1"
            android:shadowRadius="1"
            android:textColor="#6c6c6c"
            android:textSize="10pt" >
        </Button>

        <Button
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/button23"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/buttonbg"
            android:gravity="left|center"
            android:padding="10dp"
            android:shadowColor="#f5f5f5"
            android:shadowDx="1"
            android:shadowDy="1"
            android:shadowRadius="1"
            android:textColor="#6c6c6c"
            android:textSize="10pt" >
        </Button>

        <Button
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/button24"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/buttonbg"
            android:gravity="left|center"
            android:padding="10dp"
            android:shadowColor="#f5f5f5"
            android:shadowDx="1"
            android:shadowDy="1"
            android:shadowRadius="1"
            android:textColor="#6c6c6c"
            android:textSize="10pt" >
        </Button>

        <Button
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/button25"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/buttonbg"
            android:gravity="left|center"
            android:padding="10dp"
            android:shadowColor="#f5f5f5"
            android:shadowDx="1"
            android:shadowDy="1"
            android:shadowRadius="1"
            android:textColor="#6c6c6c"
            android:textSize="10pt" >
        </Button>

        <WebView
            android:id="@+id/accesskey"
            android:layout_width="fill_parent"
            android:layout_height="100dp" />
    </LinearLayout>
</ScrollView>

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:ads="http://schemas.android.com/apk/res/com.murdersquirrel.newboard"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignBottom="@+id/home_layout"
    android:layout_alignParentBottom="true"
    android:background="#ffffff"
    android:gravity="bottom"
    android:orientation="vertical" >

    <com.google.ads.AdView
        android:id="@+id/adView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        ads:adSize="BANNER"
        ads:adUnitId="a14fb507753fada" />
</LinearLayout>

按钮,

<Button
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/masthead"
        android:layout_width="fill_parent"
        android:layout_height="80dp"
        android:background="@drawable/mastbg"
        android:gravity="left|center" >
    </Button>

充当应用程序 Logo ,所以我不喜欢它是滚动的。我需要将它固定在顶部。

谢谢!

最佳答案

只需将您的 xml 设计为...

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res/com.apperspray.scarface"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/bg1"
android:orientation="vertical" >

<Button
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/masthead"
        android:layout_width="fill_parent"
        android:layout_height="80dp"
        android:background="@drawable/mastbg"
        android:gravity="top"
        android:layout_alignParentTop="true">
    </Button>

<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrollview1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/masthead">

<LinearLayout
    android:id="@+id/home_layout"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="#000000"
    android:orientation="vertical" >

    <Button
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/button01"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/buttonbg"
        android:gravity="left|center"
        android:padding="10dp"
        android:shadowColor="#f5f5f5"
        android:shadowDx="1"
        android:shadowDy="1"
        android:shadowRadius="1"
        android:textColor="#6c6c6c"
        android:textSize="10pt" >
    </Button>

    <Button
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/button02"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/buttonbg"
        android:gravity="left|center"
        android:padding="10dp"
        android:shadowColor="#f5f5f5"
        android:shadowDx="1"
        android:shadowDy="1"
        android:shadowRadius="1"
        android:textColor="#6c6c6c"
        android:textSize="10pt" >
    </Button>

    <Button
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/button03"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/buttonbg"
        android:gravity="left|center"
        android:padding="10dp"
        android:shadowColor="#f5f5f5"
        android:shadowDx="1"
        android:shadowDy="1"
        android:shadowRadius="1"
        android:textColor="#6c6c6c"
        android:textSize="10pt" >
    </Button>

    <Button
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/button04"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/buttonbg"
        android:gravity="left|center"
        android:padding="10dp"
        android:shadowColor="#f5f5f5"
        android:shadowDx="1"
        android:shadowDy="1"
        android:shadowRadius="1"
        android:textColor="#6c6c6c"
        android:textSize="10pt" >
    </Button>

    <Button
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/button05"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/buttonbg"
        android:gravity="left|center"
        android:padding="10dp"
        android:shadowColor="#f5f5f5"
        android:shadowDx="1"
        android:shadowDy="1"
        android:shadowRadius="1"
        android:textColor="#6c6c6c"
        android:textSize="10pt" >
    </Button>

    <Button
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/button06"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/buttonbg"
        android:gravity="left|center"
        android:padding="10dp"
        android:shadowColor="#f5f5f5"
        android:shadowDx="1"
        android:shadowDy="1"
        android:shadowRadius="1"
        android:textColor="#6c6c6c"
        android:textSize="10pt" >
    </Button>

    <Button
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/button07"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/buttonbg"
        android:gravity="left|center"
        android:padding="10dp"
        android:shadowColor="#f5f5f5"
        android:shadowDx="1"
        android:shadowDy="1"
        android:shadowRadius="1"
        android:textColor="#6c6c6c"
        android:textSize="10pt" >
    </Button>

    <Button
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/button08"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/buttonbg"
        android:gravity="left|center"
        android:padding="10dp"
        android:shadowColor="#f5f5f5"
        android:shadowDx="1"
        android:shadowDy="1"
        android:shadowRadius="1"
        android:textColor="#6c6c6c"
        android:textSize="10pt" >
    </Button>

    <Button
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/button09"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/buttonbg"
        android:gravity="left|center"
        android:padding="10dp"
        android:shadowColor="#f5f5f5"
        android:shadowDx="1"
        android:shadowDy="1"
        android:shadowRadius="1"
        android:textColor="#6c6c6c"
        android:textSize="10pt" >
    </Button>

    <Button
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/button10"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/buttonbg"
        android:gravity="left|center"
        android:padding="10dp"
        android:shadowColor="#f5f5f5"
        android:shadowDx="1"
        android:shadowDy="1"
        android:shadowRadius="1"
        android:textColor="#6c6c6c"
        android:textSize="10pt" >
    </Button>

    <Button
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/button11"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/buttonbg"
        android:gravity="left|center"
        android:padding="10dp"
        android:shadowColor="#f5f5f5"
        android:shadowDx="1"
        android:shadowDy="1"
        android:shadowRadius="1"
        android:textColor="#6c6c6c"
        android:textSize="10pt" >
    </Button>

    <Button
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/button12"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/buttonbg"
        android:gravity="left|center"
        android:padding="10dp"
        android:shadowColor="#f5f5f5"
        android:shadowDx="1"
        android:shadowDy="1"
        android:shadowRadius="1"
        android:textColor="#6c6c6c"
        android:textSize="10pt" >
    </Button>

    <Button
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/button13"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/buttonbg"
        android:gravity="left|center"
        android:padding="10dp"
        android:shadowColor="#f5f5f5"
        android:shadowDx="1"
        android:shadowDy="1"
        android:shadowRadius="1"
        android:textColor="#6c6c6c"
        android:textSize="10pt" >
    </Button>

    <Button
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/button14"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/buttonbg"
        android:gravity="left|center"
        android:padding="10dp"
        android:shadowColor="#f5f5f5"
        android:shadowDx="1"
        android:shadowDy="1"
        android:shadowRadius="1"
        android:textColor="#6c6c6c"
        android:textSize="10pt" >
    </Button>

    <Button
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/button15"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/buttonbg"
        android:gravity="left|center"
        android:padding="10dp"
        android:shadowColor="#f5f5f5"
        android:shadowDx="1"
        android:shadowDy="1"
        android:shadowRadius="1"
        android:textColor="#6c6c6c"
        android:textSize="10pt" >
    </Button>

    <Button
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/button16"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/buttonbg"
        android:gravity="left|center"
        android:padding="10dp"
        android:shadowColor="#f5f5f5"
        android:shadowDx="1"
        android:shadowDy="1"
        android:shadowRadius="1"
        android:textColor="#6c6c6c"
        android:textSize="10pt" >
    </Button>

    <Button
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/button17"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/buttonbg"
        android:gravity="left|center"
        android:padding="10dp"
        android:shadowColor="#f5f5f5"
        android:shadowDx="1"
        android:shadowDy="1"
        android:shadowRadius="1"
        android:textColor="#6c6c6c"
        android:textSize="10pt" >
    </Button>

    <Button
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/button18"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/buttonbg"
        android:gravity="left|center"
        android:padding="10dp"
        android:shadowColor="#f5f5f5"
        android:shadowDx="1"
        android:shadowDy="1"
        android:shadowRadius="1"
        android:textColor="#6c6c6c"
        android:textSize="10pt" >
    </Button>

    <Button
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/button19"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/buttonbg"
        android:gravity="left|center"
        android:padding="10dp"
        android:shadowColor="#f5f5f5"
        android:shadowDx="1"
        android:shadowDy="1"
        android:shadowRadius="1"
        android:textColor="#6c6c6c"
        android:textSize="10pt" >
    </Button>

    <Button
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/button20"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/buttonbg"
        android:gravity="left|center"
        android:padding="10dp"
        android:shadowColor="#f5f5f5"
        android:shadowDx="1"
        android:shadowDy="1"
        android:shadowRadius="1"
        android:textColor="#6c6c6c"
        android:textSize="10pt" >
    </Button>

    <Button
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/button21"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/buttonbg"
        android:gravity="left|center"
        android:padding="10dp"
        android:shadowColor="#f5f5f5"
        android:shadowDx="1"
        android:shadowDy="1"
        android:shadowRadius="1"
        android:textColor="#6c6c6c"
        android:textSize="10pt" >
    </Button>

    <Button
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/button22"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/buttonbg"
        android:gravity="left|center"
        android:padding="10dp"
        android:shadowColor="#f5f5f5"
        android:shadowDx="1"
        android:shadowDy="1"
        android:shadowRadius="1"
        android:textColor="#6c6c6c"
        android:textSize="10pt" >
    </Button>

    <Button
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/button23"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/buttonbg"
        android:gravity="left|center"
        android:padding="10dp"
        android:shadowColor="#f5f5f5"
        android:shadowDx="1"
        android:shadowDy="1"
        android:shadowRadius="1"
        android:textColor="#6c6c6c"
        android:textSize="10pt" >
    </Button>

    <Button
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/button24"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/buttonbg"
        android:gravity="left|center"
        android:padding="10dp"
        android:shadowColor="#f5f5f5"
        android:shadowDx="1"
        android:shadowDy="1"
        android:shadowRadius="1"
        android:textColor="#6c6c6c"
        android:textSize="10pt" >
    </Button>

    <Button
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/button25"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/buttonbg"
        android:gravity="left|center"
        android:padding="10dp"
        android:shadowColor="#f5f5f5"
        android:shadowDx="1"
        android:shadowDy="1"
        android:shadowRadius="1"
        android:textColor="#6c6c6c"
        android:textSize="10pt" >
    </Button>

    <WebView
        android:id="@+id/accesskey"
        android:layout_width="fill_parent"
        android:layout_height="100dp" />
</LinearLayout>

    <com.google.ads.AdView
    android:id="@+id/adView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    ads:adSize="BANNER"
    ads:adUnitId="a14fb507753fada" />

关于android - 使第一个按钮固定在 ScrollView 上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10684203/

相关文章:

xml - 在 R 中,如何遍历重复的 XML 节点,并将文本值保存在列表中?

Android:绘制基本的圆形轮廓到 RelativeLayout

android - 交叉构建 native 编译器问题 : Segfaults in Compiler or Compiled Binary

java - 如何从 Android 应用程序的音乐库中排除声音 fragment

android - 将Firebase数据库转换为Cloud Firestore

android - AppWidgetManager getAppWidgetIds 返回旧的 Widget id

html - XML/XSLT 转换逻辑/If 语句/隐藏某些行

c# - 是否可以为 XAttribute 和 XElement 编写方法?

android - Android中具有负半径的形状角

android - 我为android设计的底部 ListView 没有完全显示