4月20日

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#01092C"
    android:orientation="vertical"
    tools:context=".MainActivity2" >


    <LinearLayout
        android:layout_marginTop="10dp"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical"
        >
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">
            <EditText
                android:layout_marginLeft="10dp"
                android:layout_marginRight="5dp"
                android:layout_gravity="center"
                android:layout_weight="1"
                android:background="#CFCACA"
                android:id="@+id/IPText"
                android:layout_width="match_parent"
                android:layout_height="40dp"
                android:ems="10"
                android:textSize="20dp"
                android:hint="请输入衣柜服务端的IP地址"
                tools:ignore="HardcodedText" />

            <Button
                android:layout_marginRight="10dp"
                android:layout_weight="2"
                android:id="@+id/StartConnect"
                android:background="#C3C7DA"
                android:layout_width="match_parent"
                android:layout_height="40dp"
                android:textSize="20dp"
                android:text="连接空调" />
        </LinearLayout>


        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content" >

            <TextView
                android:id="@+id/tv1"
                android:layout_marginTop="10dp"
                android:layout_marginLeft="20dp"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textColor="#ffffff"
                android:text="欢迎使用智能空调!(设备未连接!)"
                android:textSize="20dp" />

        </RelativeLayout>
        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <com.example.zhineng.TempControlView
                android:id="@+id/temp_control"
                android:layout_width="250dp"
                android:layout_height="250dp">
            </com.example.zhineng.TempControlView>
            <Switch
                android:layout_gravity="center"
                android:id="@+id/switch_c"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textOff="OFF"
                android:textOn="ON"
                android:thumb="@drawable/thumb"
                android:track="@drawable/track"
                android:background="#ffffff"
                tools:ignore="HardcodedText" />

        </LinearLayout>



        <LinearLayout
            android:layout_marginLeft="10dp"
            android:orientation="horizontal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            >
            <TextView
                android:layout_weight="1"
                android:textSize="25sp"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textColor="#F3DBDB"
                android:text="温度:0℃"
                android:id="@+id/textView3" />

            <TextView
                android:layout_weight="1"
                android:textSize="25sp"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="湿度:0%"
                android:textColor="#F3DBDB"
                android:id="@+id/textView4" />
        </LinearLayout>

    </LinearLayout>
</RelativeLayout>

修改之后的空调界面

posted @ 2023-04-20 23:23  辞楠  阅读(9)  评论(0)    收藏  举报