您的位置:首页 > 移动开发 > Android开发

android省市区三级联动案例:(三)布局文件

2015-07-30 19:16 519 查看
主页面:

<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" >

<RelativeLayout
android:id="@+id/ly_title"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginTop="5dp"
android:background="@drawable/top_bg" >

<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="地区选择"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#ffffff" />
</RelativeLayout>

<!-- 省份-->
<RelativeLayout
android:id="@+id/ly_province"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_below="@+id/ly_title" >

<TextView
android:id="@+id/tvlabel_province"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="省份"
android:textColor="#919199"
android:layout_centerVertical="true"
android:textSize="20sp" />
<TextView
android:id="@+id/tv_province"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/tvlabel_province"
android:layout_marginLeft="40dp"
android:layout_marginRight="10dp"
android:layout_centerHorizontal="true"
android:hint="请选择省份"
android:textColor="#919199"
android:layout_centerVertical="true"
android:textSize="20sp" />

<ImageView
android:id="@+id/iv_province"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="5dp"
android:layout_centerVertical="true"
android:background="@drawable/right_btn_icon" />

<ImageView
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="@+id/tv_province"
android:layout_alignParentRight="true"
android:background="@drawable/line" />
</RelativeLayout>

<!-- 城市-->
<RelativeLayout
android:id="@+id/ly_city"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_below="@+id/ly_province" >

<TextView
android:id="@+id/tvlabel_city"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="城市"
android:textColor="#919199"
android:layout_centerVertical="true"
android:textSize="20sp" />
<TextView
android:id="@+id/tv_city"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/tvlabel_city"
android:layout_marginLeft="40dp"
android:layout_marginRight="10dp"
android:layout_centerHorizontal="true"
android:hint="请选择城市"
android:textColor="#919199"
android:layout_centerVertical="true"
android:textSize="20sp" />

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="5dp"
android:layout_centerVertical="true"
android:background="@drawable/right_btn_icon" />

<ImageView
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="@+id/tv_city"
android:layout_alignParentRight="true"
android:background="@drawable/line" />
</RelativeLayout>

<!-- 地区 -->
<RelativeLayout
android:id="@+id/ly_area"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_below="@+id/ly_city" >

<TextView
android:id="@+id/tvlabel_area"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="地区"
android:textColor="#919199"
android:layout_centerVertical="true"
android:textSize="20sp" />
<TextView
android:id="@+id/tv_area"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/tvlabel_area"
android:layout_marginLeft="40dp"
android:layout_marginRight="10dp"
android:layout_centerHorizontal="true"
android:hint="请选择地区"
android:textColor="#919199"
android:layout_centerVertical="true"
android:textSize="20sp" />

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="5dp"
android:layout_centerVertical="true"
android:background="@drawable/right_btn_icon" />

<ImageView
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="@+id/tv_area"
android:layout_alignParentRight="true"
android:background="@drawable/line" />
</RelativeLayout>

<Button
android:id="@+id/btnSure"
android:layout_width="120dp"
android:layout_height="50dp"
android:layout_below="@+id/ly_area"
android:layout_marginTop="10dp"
android:layout_centerHorizontal="true"
android:text="确定"
android:background="@drawable/btn_gb" />

</RelativeLayout>


地址名称

<LinearLayout 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" >

<TextView
android:id="@+id/tv_address_name"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textSize="18sp"
android:paddingLeft="20px"
android:paddingTop="20px"
android:paddingRight="20px"
android:paddingBottom="20px"/>

</LinearLayout>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: