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

主页面:

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

 

转载于:https://www.cnblogs.com/2015android/p/4690330.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值