当前位置: 首页 > news >正文

[android] 天气app布局练习

主要练习一下RelativeLayout和LinearLayout

<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="#3186D9"
    tools:context="${relativePackage}.${activityClass}" >

    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="10dp"
        android:layout_marginTop="10dp"
        android:src="@drawable/icon_home" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="12dp"
        android:text="北京"
        android:textColor="#FDFDFD" />

    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_marginRight="10dp"
        android:layout_marginTop="10dp"
        android:src="@drawable/icon_more" />

    <TextView
        android:id="@+id/tv_number"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="70dp"
        android:text="29"
        android:textColor="#fff"
        android:textSize="50sp" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignTop="@id/tv_number"
        android:layout_toRightOf="@id/tv_number"
        android:text="°"
        android:textColor="#FDFDFD"
        android:textSize="30sp" />

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/tv_number"
        android:layout_centerHorizontal="true"
        android:orientation="horizontal" >

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:text="多云"
            android:textColor="#FDFDFD" />
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:text=" | "
            android:textColor="#bbb" />
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:text="空气优"
            android:textColor="#FDFDFD" />
    </LinearLayout>

</RelativeLayout>

 

相关文章:

  • MFC知识点(DDX_Control 与 DDX_Text ,ON_COMMAND和ON_MESSAGE)
  • JavaScript操作JSON的方法总结,JSON字符串转换为JSON对象
  • Navicat for SQL Server 安装的步骤是这样的
  • PAT1005
  • 联想IPMI固件SMASH-CLP 管理
  • Android网络编程1
  • SQL Anywhere(ASA) 数据库“File is shorter than expected -- transaction rolled back”错误修复...
  • 简单快速打造你自己的PHP MVC框架
  • php系统常量
  • 将xml文件转为c#对像
  • Angular.element和$document的使用方法分析,代替jquery
  • rsyslog日志服务的配置文件分析
  • HDU 2177 —— (威佐夫博弈)
  • 7.22号布置的作业
  • HDU2097 Sky数
  • [nginx文档翻译系列] 控制nginx
  • 【每日笔记】【Go学习笔记】2019-01-10 codis proxy处理流程
  • CentOS 7 修改主机名
  • ERLANG 网工修炼笔记 ---- UDP
  • ES6系列(二)变量的解构赋值
  • Iterator 和 for...of 循环
  • jquery ajax学习笔记
  • JS函数式编程 数组部分风格 ES6版
  • KMP算法及优化
  • MySQL-事务管理(基础)
  • nodejs:开发并发布一个nodejs包
  • OpenStack安装流程(juno版)- 添加网络服务(neutron)- controller节点
  • Redux 中间件分析
  • REST架构的思考
  • SegmentFault 技术周刊 Vol.27 - Git 学习宝典:程序员走江湖必备
  • 分布式熔断降级平台aegis
  • 分类模型——Logistics Regression
  • 关于Flux,Vuex,Redux的思考
  • 腾讯优测优分享 | 你是否体验过Android手机插入耳机后仍外放的尴尬?
  • 《天龙八部3D》Unity技术方案揭秘
  • Semaphore
  • ​​​​​​​GitLab 之 GitLab-Runner 安装,配置与问题汇总
  • ​LeetCode解法汇总2808. 使循环数组所有元素相等的最少秒数
  • ​如何使用ArcGIS Pro制作渐变河流效果
  • ​总结MySQL 的一些知识点:MySQL 选择数据库​
  • #基础#使用Jupyter进行Notebook的转换 .ipynb文件导出为.md文件
  • #我与Java虚拟机的故事#连载01:人在JVM,身不由己
  • (1综述)从零开始的嵌入式图像图像处理(PI+QT+OpenCV)实战演练
  • (2015)JS ES6 必知的十个 特性
  • (3)(3.2) MAVLink2数据包签名(安全)
  • (floyd+补集) poj 3275
  • (pojstep1.1.2)2654(直叙式模拟)
  • (react踩过的坑)antd 如何同时获取一个select 的value和 label值
  • (附源码)ssm高校升本考试管理系统 毕业设计 201631
  • (附源码)ssm基于web技术的医务志愿者管理系统 毕业设计 100910
  • (附源码)计算机毕业设计SSM教师教学质量评价系统
  • (三十五)大数据实战——Superset可视化平台搭建
  • (一)认识微服务
  • (原)Matlab的svmtrain和svmclassify
  • *++p:p先自+,然后*p,最终为3 ++*p:先*p,即arr[0]=1,然后再++,最终为2 *p++:值为arr[0],即1,该语句执行完毕后,p指向arr[1]