游戏手柄模板

来源:互联网 发布:库里总决赛6场数据 编辑:程序博客网 时间:2024/05/03 09:15


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal" >

    <Button
        android:id="@+id/lb"
        android:layout_width="0px"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:layout_weight="1"
        android:text="←" />

    <RelativeLayout
        android:layout_width="0px"
        android:layout_height="match_parent"
        android:layout_weight="1" >

        <Button
            android:id="@+id/cb"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:text="○" />

        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_above="@id/cb"
            android:layout_alignLeft="@id/cb"
            android:text="↑" />

        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignRight="@id/cb"
            android:layout_below="@id/cb"
            android:text="↓" />
    </RelativeLayout>

    <Button
        android:id="@+id/rb"
        android:layout_width="0px"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:layout_weight="1"
        android:text="→" />

    <RelativeLayout
        android:layout_width="0px"
        android:layout_height="match_parent"
        android:layout_weight="1" >

        <Button
            android:id="@+id/ivb"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:visibility="invisible" />

        <Button
            android:id="@+id/sb"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignRight="@id/ivb"
            android:layout_below="@id/ivb"
            android:text="start"
            android:textSize="10sp" />
    </RelativeLayout>

    <RelativeLayout
        android:layout_width="0px"
        android:layout_height="match_parent"
        android:layout_weight="1" >

        <Button
            android:id="@+id/ivb2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:visibility="invisible" />

        <Button
            android:id="@+id/reb"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignRight="@id/ivb2"
            android:layout_below="@id/ivb2"
            android:text="reset"
            android:textSize="10sp" />
    </RelativeLayout>

    <RelativeLayout
        android:layout_width="0px"
        android:layout_height="match_parent"
        android:layout_weight="1" >

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:orientation="vertical" >

            <Button
                android:id="@+id/a"
                android:layout_width="wrap_content"
                android:layout_height="0px"
                android:layout_weight="1"
                android:text="a" />

            <Button
                android:id="@+id/b"
                android:layout_width="wrap_content"
                android:layout_height="0px"
                android:layout_weight="1"
                android:text="b" />
        </LinearLayout>
    </RelativeLayout>

    <RelativeLayout
        android:layout_width="0px"
        android:layout_height="match_parent"
        android:layout_weight="1" >

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:orientation="vertical" >

            <Button
                android:id="@+id/A"
                android:layout_width="wrap_content"
                android:layout_height="0px"
                android:layout_weight="1"
                android:text="A" />

            <Button
                android:id="@+id/B"
                android:layout_width="wrap_content"
                android:layout_height="0px"
                android:layout_weight="1"
                android:text="B" />
        </LinearLayout>
    </RelativeLayout>

</LinearLayout>



1 0
原创粉丝点击