复习Android布局
效果如图:
这里没有做逻辑的处理,仅仅是布局的罗列。包括垂直和水平的线性布局,以及一个滚动的view。
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:ignore="InvalidId"> <ImageView
android:id="@+id/imageShopIcon"
android:layout_width="match_parent"
android:layout_height="52dp"
android:layout_weight="1"
android:scaleType="fitXY"
android:src="@drawable/shopicon"
tools:ignore="Suspicious0dp"></ImageView> <ImageView
android:layout_width="match_parent"
android:layout_height="233dp"
android:layout_weight="4"
android:scaleType="fitXY"
android:src="@drawable/room" />
<LinearLayout
android:id="@+id/textLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="5"
android:orientation="vertical"
android:layout_marginLeft="10dp"
android:layout_marginTop="15dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="48sp"
android:text="时尚咖啡厅" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" android:orientation="horizontal"> <ImageView
android:layout_width="66dp"
android:layout_height="43dp"
android:layout_weight="1"
android:src="@drawable/gps" /> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18sp"
android:layout_weight="9"
android:text="山东省青岛市崂山区中国海洋大学校内教育超市3楼" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal"> <ImageView
android:layout_width="49dp"
android:layout_height="24dp"
android:layout_weight="1"
android:src="@drawable/phone" /> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18sp"
android:layout_weight="9"
android:text="0532-6678123" />
</LinearLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_marginTop="20dp"
android:textSize="30dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="欢迎大家品尝欢迎大家品尝欢迎大家品尝欢迎大家品尝欢迎大家品尝欢迎大家品尝欢迎大家品尝欢迎大家品尝欢迎大家品尝欢迎大家品尝欢迎大家品尝欢迎大家品尝欢迎大家品尝欢迎大家品尝欢迎大家品尝"/>
</ScrollView>
</LinearLayout>
</LinearLayout>
</RelativeLayout> </android.support.constraint.ConstraintLayout>
布局代码
复习Android布局的更多相关文章
- 【转】在Android布局中使用include和merge标签
内容转自:http://fengweipeng1208.blog.163.com/blog/static/21277318020138229754135/ 在我们开发android布局时,经常会有很多 ...
- Android成长日记-Android布局优化
Android常用布局 1. LinearLayout(线性布局) 2. RelativeLayout(相对布局) 3. TableLayout(表格布局) 4. AbsoluteLayou(绝对布局 ...
- 【转】Android布局优化之ViewStub
ViewStub是Android布局优化中一个很不错的标签/控件,直接继承自View.虽然Android开发人员基本上都听说过,但是真正用的可能不多. ViewStub可以理解成一个非常轻量级的Vie ...
- Android 布局之LinearLayout
Android 布局之LinearLayout 1 LinearLayout简介 LinearLayout是线程布局.它包括2个方向(android:orientation):“水平”(horizon ...
- Android 布局之RelativeLayout
Android 布局之RelativeLayout 1 RelativeLayout简介 RelativeLayout是相对布局. RelativeLayout布局属性 1.1 与parent相对的属 ...
- Android 布局之TableLayout
Android 布局之TableLayout 1 TableLayout简介 TableLayout是表格布局.TableLayout 可设置的属性包括全局属性及单元格属性. 1.1 全局属性 有以下 ...
- Android 布局之FrameLayout
Android 布局之FrameLayout 1 FrameLayout简介 对于FrameLayout,官方介绍是:FrameLayout is designed to block out an a ...
- Android 布局之GridLayout
Android 布局之GridLayout 1 GridLayout简介 GridLayout是Android4.0新提供的网格矩阵形式的布局控件. GridLayout的继承关系如下:java.la ...
- Xamarin Android布局文件没有智能提示
Xamarin Android布局文件没有智能提示 在Visual Studio 2015中,Android项目的Main.axml文件没有智能提示,不便于布局文件的编写.解决办法:(1)从Xamar ...
随机推荐
- 论文阅读:Deformable ConvNets v2
论文地址:http://arxiv.org/abs/1811.11168 作者:pprp 时间:2019年5月11日 0. 摘要 DCNv1引入了可变形卷积,能更好的适应目标的几何变换.但是v1可视化 ...
- 数据库中的Schema到底是什么
参考:http://database.guide/what-is-a-database-schema/ 在数据库中,schema(发音 “skee-muh” 或者“skee-mah”,中文叫模式)是数 ...
- charles 主界面总结
本文参考:charles 主界面总结 charles 主界面的介绍 Charles 主要提供两种查看封包的视图,分别名为 Structure Structure/结构视图,将网络请求按访问的域名分类, ...
- 开源框架---tensorflow c++ API 运行第一个“手写字的例子”
#CMakeLists.txt cmake_minimum_required (VERSION ) project (tf_example) set(CMAKE_CXX_FLAGS "${C ...
- Docker那些事儿之编排工具docker-compose
前面已经讲解过docker的一些基础使用,镜像创建的操作过程,如果大量容器需要同时部署,一个一个容器进行服务器上的部署,估计要疯掉,在使用上我们需要找到更好更便捷的使用方式,今天要讲解的容器编排工具d ...
- plus代码闪光点
1. 快速变成 String 格式: { stamp: +new Date() } 2. 封装axios请求: axios.get(this.URI, { params: { }, withCrede ...
- THINKPHP SQL注入处理方式
//注入的产生一般都是对用户输入的参数未做任何处理直接对条件和语句进行拼装. //不安全的写法举例1 $_GET['id']=8;//希望得到的是正整数 $data=M('Member')->w ...
- SQL 学习指南-数据库使用
1.缺失子句 now() 是MySQL的内建函数,返回当前的日期和时间.在MySQL中可以直接使用下列语句查询: SELECT NOW(); 但是某些数据库规定查询语句必须包含 from 子句,并在其 ...
- E:nth-of-type(n)
E:nth-of-type(n) 语法: E:nth-of-type(n) { sRules } 说明: 匹配同类型中的第n个同级兄弟元素E.深圳dd马达 要使该属性生效,E元素必须是某个元素的子元素 ...
- DOM Diff(差分)算法
1. 算法由来 React调用render()方法后,会生成一个React元素组成的树. 再次调用,生成一个新的树.React比较两者的差异,然后更新UI. 如果单纯使用算法,来查找两个DOM树的差异 ...