Lay_Weight 权重属性的使用

<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:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin"
    tools:context="com.dr.app.drseamoniter.SearchConditionActivity"
    android:background="#F0F0F0"
    >

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="#F0F0F0"
        >
        <LinearLayout
            android:orientation="horizontal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#FFFFFF"
            android:gravity="center_vertical"
            android:padding="5dp"
            android:layout_margin="5dp"
            >
            <ImageView
                android:id="@+id/search_area_img"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:src="@drawable/search_area_img"
                android:gravity="center"
                android:layout_weight="2"
                />
            <TextView
                android:id="@+id/search_area_text"
                android:layout_height="fill_parent"
                android:layout_width="fill_parent"
                android:layout_weight="2"
                android:gravity="center"
                android:text="选择区域:"/>
            <com.dr.app.drseamoniter.spinner.SearchConditionSpinner
                android:id="@+id/search_area_condition"
                android:layout_height="fill_parent"
                android:layout_width="fill_parent"
                android:gravity="center"
                android:layout_weight="1"
                />
        </LinearLayout>
        <LinearLayout
            android:orientation="horizontal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#FFFFFF"
            android:gravity="center"
            android:padding="5dp"
            android:layout_margin="5dp"
            >
            <ImageView
                android:id="@+id/search_dev_img"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:src="@drawable/search_dev_img"
                android:gravity="center"
                android:layout_weight="2"/>
            <TextView
                android:id="@+id/search_dev_text"
                android:layout_height="fill_parent"
                android:layout_width="fill_parent"
                android:text="选择设备:"
                android:gravity="center"
                android:layout_weight="2"/>
            <com.dr.app.drseamoniter.spinner.SearchConditionSpinner
                android:id="@+id/search_dev_condition"
                android:layout_height="fill_parent"
                android:layout_width="fill_parent"
                android:gravity="center"
                android:layout_weight="1" />
        </LinearLayout>
        <LinearLayout
            android:orientation="horizontal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#FFFFFF"
            android:gravity="center"
            android:padding="5dp"
            android:layout_margin="5dp"
            >
            <ImageView
                android:id="@+id/search_begintime_img"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:src="@drawable/search_time_img"
                android:gravity="center"
                android:layout_weight="2"/>
            <TextView
                android:id="@+id/search_begintime_text"
                android:layout_height="fill_parent"
                android:layout_width="fill_parent"
                android:text="开始时间:"
                android:gravity="center"
                android:layout_weight="2"/>
            <EditText
                android:id="@+id/search_begintime_edittext"
                android:layout_height="fill_parent"
                android:layout_width="fill_parent"
                android:layout_weight="1"
                android:background="@null"
                android:inputType="text"
                android:gravity="center"
                android:textSize="15sp"/>
        </LinearLayout>
        <LinearLayout
            android:orientation="horizontal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#FFFFFF"
            android:gravity="center"
            android:padding="5dp"
            android:layout_margin="5dp"
            >
            <ImageView
                android:id="@+id/search_endtime_img"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:src="@drawable/search_time_img"
                android:gravity="center"
                android:layout_weight="2"/>
            <TextView
                android:id="@+id/search_endtime_text"
                android:layout_height="fill_parent"
                android:layout_width="fill_parent"
                android:gravity="center"
                android:text="结束时间:"
                android:layout_weight="2"/>
            <EditText
                android:id="@+id/search_endtime_edittext"
                android:layout_height="fill_parent"
                android:layout_width="fill_parent"
                android:layout_weight="1"
                android:background="@null"
                android:inputType="text"
                android:gravity="center"
                android:textSize="15sp"
                />
        </LinearLayout>
        <LinearLayout
            android:orientation="horizontal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:padding="5dp"
            android:layout_margin="5dp"
            >
            <Button
                android:id="@+id/search_btn"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:padding="15dp"
                android:background="#0077D9"
                android:textColor="@android:color/white"
                android:text="查询"/>

        </LinearLayout>
    </LinearLayout>

</RelativeLayout>

参考博客Android:Layout_weight的深刻理解

Android --Search界面样式的更多相关文章

  1. Android学习系列(40)--Android主题和样式之系统篇(下)

    11)Widget样式(Widget Style) 特别说明,此处定义大量的系统内置控件的样式,对于重写原生控件的样式具有很大的参考价值. <!-- Widget styles --> & ...

  2. Android开发工程师文集-Fragment,适配器,轮播图,ScrollView,Gallery 图片浏览器,Android常用布局样式

    Android开发工程师文集-Fragment,适配器,轮播图,ScrollView,Gallery 图片浏览器,Android常用布局样式 Fragment FragmentManager frag ...

  3. Android典型界面设计(5)——使用SlidingMenu和DrawerLayout分别实现左右侧边栏

    一.问题描述 侧边栏是Android应用中十分常见的界面效果,可随主屏在左侧或右侧联动,是特别适应手机等小屏幕特性的典型界面设计方案之一,常用作应用的操作菜单,如图所示 实现侧边栏可以使用第三方组件s ...

  4. Android典型界面设计(6)——ActionBar Tab+ViewPager+Fagment实现滑动导航

    一.问题描述 在Android典型界面设计一文中,实现典型滑动导航界面,其实使用ActionBar 也可以轻松实现这一效果,甚至也可实现类似Android典型界面设计(3)的双导航效果.可见Actio ...

  5. Android典型界面设计(7) ——DrawerLayout+Fragement+ViewPager+PagerTabStrip实现双导航

    一.问题描述 在Android典型界面设计(3)的我们实现了双导航效果,即外层底部导航和内部区域的头部导航,如网易新闻等很多应用采用了这种导航,但Google提供DrawerLayout可实现抽屉式导 ...

  6. android中的样式主题和国际化

    一.Android中的样式和主题     1.1样式     样式是作用在控件上的,它是一个包含一个或者多个view控件属性的集合.android style类似网页设计中的css设计思路,可以让设计 ...

  7. Android流行界面结构——Fragment通过ViewPager(带指示器)嵌套Fragment结构的创建方法详解

    原创文章,转载请注明出处http://www.cnblogs.com/baipengzhan/p/6287213.html 当前Android流行界面结构的一种——Fragment通过ViewPage ...

  8. (转载)Android引导界面实现

    Android引导界面实现 Android   2014-07-10 14:47:36 发布 您的评价:       4.0   收藏     3收藏 ViewPager类提供了多界面切换的新效果,是 ...

  9. Android RatingBar 自定义样式

    Android RatingBar 自定义样式 1.先定义Style: <style name="RadingStyle" parent="@android:sty ...

随机推荐

  1. myeclipse10 将一个java工程合并到web工程

    参考:zhaoshijie http://zhaoshijie.iteye.com/blog/ baidu: http://zhidao.baidu.com/link?url=WXr-EgI0OyUs ...

  2. PowerShell - Read an Excel file using COM Interface

    http://www.lazywinadmin.com/2014/03/powershell-read-excel-file-using-com.html

  3. ImageMagick jmagick 安装

    在安装ImageMagick之前,请检查下面包已经安装 tiff-3.9.5.tar.gz         (rpm -qa|grep libtiff检查是否已经安装) libpng-1.2.46.t ...

  4. pod 安装 Masonry 遇到问题

    pod 导入第三方库 Masonry: 在工程masonryTest的文件下新建一个Podfile文件 编辑如下内容: platform :ios, '8.0'xcodeproj 'mansoryTe ...

  5. autoLayout 纯代码

    SB中拖好空间,让后分别在,Pin,Align,Resolve Auto Layout Issues三个面板中设置好约束就好了. 用存代码的方式给控件添加约束,完成自动布局: 利用NSLayoutCo ...

  6. HDU 1789 贪心经典

    题意 给出n门作业的截止时间与分数 如果不能在那天结束前做完就扣掉相应分数 问怎么安排能让扣分最少 思路 先按分数从大到小排序 先研究大的 做好标记 一开始每天都能放作业 全是true 如果这一天已经 ...

  7. 《Java核心技术卷一》笔记 多线程

    有时,我们需要在一个程序中同时并行的处理多个任务,如播放器一边要播放音乐同时还要不断更新画面显示,或者是一边执行耗时任务,UI还能一边继续响应各种事件.还有的时候,一个任务需要很长时间才能完成,如果分 ...

  8. FlowVisor 安装

    参考:Github-FlowVisor-wiki 第一步 添加公钥: 命令: $ wget http://updates.onlab.us/GPG-KEY-ONLAB $ sudo apt-key a ...

  9. ThinkPHP 学习笔记 ( 三 ) 数据库操作之数据表模型和基础模型 ( Model )

    //TP 恶补ing... 一.定义数据表模型 1.模型映射 要测试数据库是否正常连接,最直接的办法就是在当前控制器中实例化数据表,然后使用 dump 函数输出,查看数据库的链接状态.代码: publ ...

  10. Oracle 数据库安装

    下载 www.oracle.com ->Downloads -> Oracle Database 安装: 解压到同一文件夹下 仅安装数据库软件 单实例数据库安装 企业版 oracle基目录 ...