[android] 天气app布局练习(三)
主要练习LinearLayout和layout_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: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:id="@+id/ll_weather"
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> <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="vertical" > <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="15dp"
android:orientation="horizontal" > <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_horizontal"
android:orientation="vertical" > <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="今天"
android:textColor="#eee" /> <ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/icon_weather" /> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="20 /25°"
android:textColor="#eee" />
</LinearLayout> <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_horizontal"
android:orientation="vertical" > <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="明天"
android:textColor="#eee" /> <ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/icon_weather" /> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="20 /25°"
android:textColor="#eee" />
</LinearLayout> <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_horizontal"
android:orientation="vertical" > <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="后天"
android:textColor="#eee" /> <ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/icon_weather" /> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="20 /25°"
android:textColor="#eee" />
</LinearLayout>
</LinearLayout> <GridView
android:id="@+id/gv_airs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ddd"
android:gravity="center"
android:horizontalSpacing="1dp"
android:listSelector="@android:color/transparent"
android:numColumns="3"
android:padding="1dp"
android:scrollbars="none"
android:stretchMode="columnWidth"
android:verticalSpacing="1dp" />
</LinearLayout> </RelativeLayout>
[android] 天气app布局练习(三)的更多相关文章
- [android] 天气app布局练习(四)
主要练习一下获取网络数据和解析xml MainActivity.java package com.example.weatherreport; import java.io.UnsupportedEn ...
- [android] 天气app布局练习(二)
主要练习一下GridView MainActivity.java package com.example.weatherreport; import java.util.ArrayList; impo ...
- [android] 天气app布局练习
主要练习一下RelativeLayout和LinearLayout <RelativeLayout xmlns:android="http://schemas.android.com/ ...
- 制作一个功能丰富的Android天气App
简易天气是一个基于和风天气数据采用MD设计的Android天气App.目前的版本采用传统的MVC模式构建.通过丰富多彩的页面为用户提供日常所需的天气资讯. 项目说明 项目放在github上面 地址是: ...
- [Android]天气App 2 项目搭建
对于天气App,为了简化一些功能,暂时模仿MUUI系统提供的那个App. 本项目需要引入本人经常使用的一个工具库DroidTool,这个是本人根据工作中,收集到一些工具类,下载地址. ...
- [Android]天气App 3 网络数据的请求和Json解析
Android客户端开发,不仅仅是在Android端开发,还需要有相应的后台服务支持,否则的话,客户端的数据就只能放到本地自己做处理.我认为的原生态的App就是对应服务端的Client.他能像浏览 ...
- [Android]天气App 1
闲赋在家,无事可做就想着做点东西,于是乎把玩手机,我最常用的就是看天气,基本上我每天起来第一件事就是看天气,哈哈,用别人的这么爽,为什么不自己整一个关于天气的应用呢,墨迹天气.小米系统自带的天气.ya ...
- DB天气app冲刺第三天
昨天很郁闷而且烦躁的的过了一天 什么也没弄.今天其实也没有怎么做..进度非常慢.. 因为个人的问题 所以这两天的效率非常慢. 但今天还是做了一些东西.把listview做出来了.做出了一个按钮的效果. ...
- Android学习系列(5)--App布局初探之简单模型
人类科技的进步源自探索,探索来自于发现本原,当然App布局没这么先进,本文也只是一个归类总结.这篇文章是Android开发人员的必备知识,是我特别为大家整理和总结的,不求完美,但是有用. Androi ...
随机推荐
- python 使用跨平台文件锁
#encoding=utf-8 print '中国' #使用跨平台文件锁 import os if os.name == 'nt': import win32con,win32file,pywinty ...
- 包(package)
一个文件夹管理多个模块文件,这个文件夹就被称为包,如下: 既然是多个模块文件,那么涉及多个模块怎么导入呢? ***当前路径下包之间模块导入: import wsg ***不同路径下包之间模块导入: f ...
- 【maven】---pom.xml-dependencies
前言 Maven在做项目开发的时候,需要用到多个jar包,这个时候,maven提供的中央仓库,就会根据依赖项,自动download需要的jar包,自动引用到项目中. 内容 具体依赖配置,集中在pom. ...
- Windows下使用DOS命令进入MySQL数据库
先要配置环境变量 MYSQL_HOME : D:\mysql-8.0.11-winx64 Path:%MYSQL_HOME%\bin 1)新建MYSQL_HOME变量,并配置:C:\Program F ...
- [Flex] 组件Tree系列 —— 支持CheckBox组件
主程序mxml: <?xml version="1.0" encoding="utf-8"?> <!--功能描述:支持CheckBox--&g ...
- Objective-C中的meta-class
讨论Objective-C的一个奇怪的概念 meta-class 在Objective-C中的每个类,都有它自己相关的meta-class,但因为你很少直接使用meta-class,所以显得很神秘. ...
- 图论 竞赛图(tournament)学习笔记
竞赛图(tournament)学习笔记 现在只是知道几个简单的性质... 竞赛图也叫有向完全图. 其实就是无向完全图的边有了方向. 有一个很有趣的性质就是:一个tournament要么没有环,如果 ...
- NOI.AC省选模拟赛第一场 T1 (树上高斯消元)
link 很容易对于每个点列出式子 \(f_{x,y}=(f_{x,y-1}+f_{x,y}+f_{x,y+1}+f_{x+1,y})/4\)(边角转移类似,略) 这个转移是相互依赖的就gg了 不过你 ...
- JAVA 集合随笔
JAVA中提供了现成操纵数据的集合,使得我们在开发中基本不用自己动手实现复杂的数据结构,来保存和操纵数据. 所以当我们有了基本的数据结构知识,会合理利用JAVA提供的集合就好啦. JDK1.8;(仅列 ...
- centos的基本命令03(du 查看文件详情,echo清空文件内容)
1:查看/etc/passwd的内容并打印出行号 强制退出vim编辑器 :q! 这个连续两个小符号, 他代表的是『结束的输入字符』的意思.这样当空行输入eof字符,输入自动结束,不用ctrl+D c ...