1.布局设计
2.代码实现
<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="@drawable/bg_shopping_menu"
tools:context=".MainActivity" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#00ff00"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="智能家居"
android:textSize="25dp"
android:layout_marginLeft="15dp"
android:layout_marginTop="6dp"
/>
<Button
android:id="@+id/zuce"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="注册"
android:layout_alignParentRight="true"
android:layout_marginRight="20dp"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="查询信息"
android:layout_toLeftOf="@id/zuce"
/>
</RelativeLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/pic_rf"
android:layout_centerInParent="true"
/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/card"
android:layout_centerInParent="true"
android:paddingLeft="120dp"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="刷卡"
android:layout_marginBottom="30dp"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
/>
</RelativeLayout>
3.运行效果
——@上官可编程