效果:
布局代码:
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/bg_environment" tools:context=".VolcanoMonitoring"> <ImageView android:id="@+id/imageView1" android:layout_width="30dp" android:layout_height="70dp" android:layout_marginLeft="30dp" android:layout_marginTop="30dp" android:src="@drawable/tab_cat" android:scaleType="centerCrop"/> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/bg_frame_dascend_setting" android:orientation="horizontal" android:padding="30dp" android:layout_marginTop="30dp" android:layout_marginRight="30dp" android:layout_marginBottom="30dp" android:layout_toRightOf="@+id/imageView1"> <LinearLayout android:layout_width="0.0dp" android:layout_height="fill_parent" android:layout_weight="1" android:gravity="center" android:orientation="vertical"> <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="0.0dp" android:layout_weight="1" android:gravity="center" android:textColor="@color/white" android:text="火焰:正常"/> <TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="0.0dp" android:layout_weight="1" android:gravity="center" android:textColor="@color/white" android:text="烟雾:正常"/> <TextView android:id="@+id/textView3" android:layout_width="wrap_content" android:layout_height="0.0dp" android:layout_weight="1" android:gravity="center" android:textColor="@color/white" android:text="非法入侵:无"/> </LinearLayout> <LinearLayout android:layout_width="0.0dp" android:layout_height="fill_parent" android:layout_weight="1" android:gravity="center"> <ImageView android:id="@+id/imageView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/fire"/> </LinearLayout> </LinearLayout> </RelativeLayout>