安卓第一二周

1

<View
        android:id="@+id/v_1"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#000000"
        android:layout_centerInParent="true"/>
    <View
        android:id="@+id/v_2"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#0EDB16"
        android:layout_above="@id/v_1"
        android:layout_toLeftOf="@id/v_1"
        />
    <View
        android:id="@+id/v_3"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#F80505"
        android:layout_above="@id/v_1"
        android:layout_toRightOf="@id/v_1"/>
    <View
        android:id="@+id/v_4"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#028FFA"
        android:layout_below="@id/v_1"
        android:layout_toRightOf="@id/v_1"/>
  
    <View
        android:id="@+id/v_5"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#D709FC"
        android:layout_below="@id/v_1"
        android:layout_toLeftOf="@id/v_1"/>
    <View
        android:id="@+id/v_6"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#FCE103"
        android:layout_below="@id/v_2"
        android:layout_toLeftOf="@id/v_1"/>
    <View
        android:id="@+id/v_7"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#03DAF8"
        android:layout_below="@id/v_1"
        android:layout_toLeftOf="@id/v_4"/>
    <View
        android:id="@+id/v_8"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#5600F3"
        android:layout_below="@id/v_2"
        android:layout_toRightOf="@id/v_1"/>
    <View
        android:id="@+id/v_9"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#09F1D7"
        android:layout_above="@id/v_1"
        android:layout_toRightOf="@id/v_2"/>

 

 2.

<?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:background="#01DFD7"
    android:layout_margin="15dp"
    android:orientation="vertical">



    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:background="#3F51B5"/>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="4"
        android:background="#FE2E2E"
        android:orientation="horizontal">
        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:background="#8BC34A"/>
        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="3"
            android:background="#FF9800"/>
        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:background="#8BC34A"/>
    </LinearLayout>>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:background="#3F51B5"/>

</LinearLayout>

 

 

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <ImageButton
        android:id="@+id/v_1"
        android:layout_width="150dp"
        android:layout_height="150dp"
        android:background="#FFFFFF"
        android:src="@drawable/tp"
        android:layout_above="@id/v_2"
        android:layout_centerInParent="true"
        ></ImageButton>
    <EditText
        android:id="@+id/v_2"
        android:layout_width="match_parent"
        android:layout_height="60dp"
        android:hint="用户名"
        android:background="@drawable/tv_1"
        android:layout_marginLeft="10dp"
        android:textColor="#000000"
        android:textSize="15sp"
        android:padding="10dp"
        android:layout_margin="15dp"
        android:drawablePadding="10dp"
        android:layout_centerInParent="true"
        android:drawableLeft="@drawable/yh"></EditText>
 
    <EditText
        android:id="@+id/v_3"
        android:layout_width="match_parent"
        android:layout_height="60dp"
        android:hint="密码"
        android:background="@drawable/tv_1"
        android:padding="10dp"
        android:textColor="#000000"
        android:textSize="15sp"
        android:layout_below="@id/v_2"
        android:layout_margin="15dp"
        android:drawablePadding="10dp"
        android:drawableLeft="@drawable/mm"></EditText>
    <Button
        android:id="@+id/btn_1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/tv_1"
        android:textColor="#00FFEE"
        android:layout_below="@id/v_3"
        android:layout_margin="15dp"
        android:text="登录"></Button>
</RelativeLayout>

 

posted @ 2021-10-08 20:35  林清欢  阅读(20)  评论(0)    收藏  举报