Android物联网应用程序开发(智慧城市)—— 环境状态值范围设置界面开发

86 阅读1分钟

代码:

布局:

<LinearLayout xmlns:android="schemas.android.com/apk/res/and…"

xmlns:app="schemas.android.com/apk/res-aut…"

xmlns:tools="schemas.android.com/tools"

android:layout_width="fill_parent"

android:layout_height="match_parent"

android:orientation="vertical">

<LinearLayout

android:layout_width="match_parent"

android:layout_height="48dip"

android:gravity="center"

android:orientation="horizontal"

android:background="@color/titleColor">

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:textColor="@android:color/white"

android:textSize="20sp"

android:text="设置"/>

<LinearLayout

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:layout_margin="5dip">

<TextView

android:layout_width="0.0dp"

android:layout_height="wrap_content"

android:layout_weight="4"

android:gravity="center"

android:text="温度范围"/>

<EditText

android:layout_width="0.0dp"

android:layout_height="wrap_content"

android:layout_weight="6"

android:ems="10" />

<TextView

android:layout_width="0.0dp"

android:layout_height="wrap_content"

android:layout_weight="4"

android:gravity="center"

android:text="至" />

<EditText

android:layout_width="0.0dp"

android:layout_height="wrap_content"

android:layout_weight="6"

android:layout_marginRight="50dip"

android:ems="10"/>

<LinearLayout

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:layout_margin="5dp">

<TextView

android:layout_width="0.0dp"

android:layout_height="wrap_content"

android:layout_weight="4"

android:layout_gravity="center"

android:text="湿度范围"/>

<EditText

android:layout_width="0.0dp"

android:layout_height="wrap_content"

android:layout_weight="6"

android:ems="10"/>

<LinearLayout

android:layout_width="0.0dp"

android:layout_height="wrap_content"

android:layout_weight="10"

android:layout_marginRight="50dip">

<LinearLayout

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:layout_margin="5dp">

<TextView

android:layout_width="0.0dp"

android:layout_height="wrap_content"

android:layout_weight="4"

android:layout_gravity="center"

android:text="光照范围"/>

<EditText

android:layout_width="0.0dp"

android:layout_height="wrap_content"

android:layout_weight="6"

android:ems="10"/>

<LinearLayout

android:layout_width="0.0dp"

android:layout_height="wrap_content"

android:layout_weight="10"

android:layout_marginRight="50dip">