效果如图:

这里没有做逻辑的处理,仅仅是布局的罗列。包括垂直和水平的线性布局,以及一个滚动的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布局的更多相关文章

  1. 【转】在Android布局中使用include和merge标签

    内容转自:http://fengweipeng1208.blog.163.com/blog/static/21277318020138229754135/ 在我们开发android布局时,经常会有很多 ...

  2. Android成长日记-Android布局优化

    Android常用布局 1. LinearLayout(线性布局) 2. RelativeLayout(相对布局) 3. TableLayout(表格布局) 4. AbsoluteLayou(绝对布局 ...

  3. 【转】Android布局优化之ViewStub

    ViewStub是Android布局优化中一个很不错的标签/控件,直接继承自View.虽然Android开发人员基本上都听说过,但是真正用的可能不多. ViewStub可以理解成一个非常轻量级的Vie ...

  4. Android 布局之LinearLayout

    Android 布局之LinearLayout 1 LinearLayout简介 LinearLayout是线程布局.它包括2个方向(android:orientation):“水平”(horizon ...

  5. Android 布局之RelativeLayout

    Android 布局之RelativeLayout 1 RelativeLayout简介 RelativeLayout是相对布局. RelativeLayout布局属性 1.1 与parent相对的属 ...

  6. Android 布局之TableLayout

    Android 布局之TableLayout 1 TableLayout简介 TableLayout是表格布局.TableLayout 可设置的属性包括全局属性及单元格属性. 1.1 全局属性 有以下 ...

  7. Android 布局之FrameLayout

    Android 布局之FrameLayout 1 FrameLayout简介 对于FrameLayout,官方介绍是:FrameLayout is designed to block out an a ...

  8. Android 布局之GridLayout

    Android 布局之GridLayout 1 GridLayout简介 GridLayout是Android4.0新提供的网格矩阵形式的布局控件. GridLayout的继承关系如下:java.la ...

  9. Xamarin Android布局文件没有智能提示

    Xamarin Android布局文件没有智能提示 在Visual Studio 2015中,Android项目的Main.axml文件没有智能提示,不便于布局文件的编写.解决办法:(1)从Xamar ...

随机推荐

  1. git命令——revert、reset

    参考:如何在 Git 中重置.恢复,返回到以前的状态 使用git时,如果对刚刚提交的后悔了怎么办,如何撤销? 方法一:手动修改 你把新增的文件删了 或者 更改过的文件再改回来,然后再commit一次. ...

  2. SUSE Ceph RBD Mirror - Storage 6

    Ceph采用的是强一致性同步模型,所有副本都必须完成写操作才算一次写入成功,这就导致不能很好地支持跨域部署,因为如果副本在异地,网络延迟就会很大,拖垮整个集群的写性能.因此,Ceph集群很少有跨域部署 ...

  3. 用js刷剑指offer(二叉搜索树的后序遍历序列)

    题目描述 输入一个整数数组,判断该数组是不是某二叉搜索树的后序遍历的结果.如果是则输出Yes,否则输出No.假设输入的数组的任意两个数字都互不相同. 牛客网链接 js代码 function Verif ...

  4. STM32 LoRaWAN探索板B-L072Z-LRWAN1入门指南

    UM2159用户手册 基于STM32L0的超低功耗LoRa探索套件入门指南 前言 LoRa 探索套件(B-L072Z-LRWAN1)是一款RF探索开发板,采用了Murata公司的LoRa模块CMWX1 ...

  5. 第五周作业:markdown语法小总结

    第五周作业 markdown语法总结 早就想写这么一个文章了,关于markdown的语法,因为最近使用的比较多,所以特地总结一下 一,标题 首先要介绍的就是标题, 标题一共有六级 # h1 ## h2 ...

  6. VGridControl 使用技巧

    1. 让列的宽度自动填充 如果VGridControl的LayoutStyle属性为BandsView或SingleRecordView,那么把VGridControl的OptionsView.Aut ...

  7. jQuery实现点击复制效果

    <!DOCTYPE html><html lang="en"> <head> <meta charset="UTF-8" ...

  8. mali tbr Forward Pixel Kill

    https://community.arm.com/cfs-file/__key/communityserver-blogs-components-weblogfiles/00-00-00-20-66 ...

  9. 【bzoj3238】差异 后缀树

    题目大意:给你一个字符串$S$,设$S_i$是串$S$第$i$长的后缀,求: $\sum\limits_{i=1}^{|S|} \sum\limits_{j=i+1}^{|S|} |S_i|+|S_j ...

  10. Vue中img的src属性绑定

    正确:<img :src=" 'files/'+value.src "> 或 <img :src="value.src">错误:< ...