Android UI Layouts: Graphics Design Using the ViewGroup Class

Android ViewGroup Superclass: A Foundation for Layouts

The ViewGroup LayoutParams Class: Layout Parameters

Deprecated Layouts: AbsoluteLayout and SlidingDrawer

absoluteLayout 3 version 1.5

SlidingDrawer 17 version 4.2(DrawerLayout  can replace)

Android’s Experimental Layout: SlidingPaneLayout

“Experimental” means that the layout container could be removed at any time (实验意味着随时都可能被删除) 用例

logical UI design usage of the SlidingPaneLayout container should include pairings of panes with logical use bindings. An example of this would be a phone number list with related dial or tagging features, a city or street list with related map features, a contact list and UI allowing interaction with the contact, or a recent e-mail list with a content pane displaying the message in the selected e-mail.

support the use of weight layout parameter android:layout_weight

Android RelativeLayout Class: Designing Relative Layouts

Android LinearLayout Class: Designing Linear Layouts

To set a weight, use a zero if the layout container is not to be stretched or use a decimal number between 0.0 and 1.0 to prorate any of those extra pixels amongst all of the UI elements (child tags) within the container.

Android FrameLayout Class: Designing Frame Layouts

注意:

It is important to note that child tags (View widgets) that are currently invisible because they’ve been specified via an Android View.GONE constant instead of using View.INVISIBLE will be utilized for FrameLayout container sizing purposes only if the .setConsiderGoneChildrenWhenMeasuring() method is called using a true parameter.

Android GridLayout Class: Designing UI Layout Grids

add in level 14

The Android Space class is a lightweight View subclass that can be used to create empty space between user interface elements in layout containers like GridLayout

does not currently provide support for the parameter called weight(假设须要,请使用LinearLayout)

you should not need to use either of the Android size value constants WRAP_CONTENT or MATCH_PARENT when you are configuring the child tags (UI elements) within your GridLayout container.

能够和数据库数据混合使用

比TableLayout更省内存

能够和FrameLayout结合。做出更复杂的效果

As I mentioned earlier, basic FrameLayout configurations can be nested and accommodated inside the cells of a GridLayout because a single cell can contain multiple View or ViewGroup objects.

To switch between two View or ViewGroup objects, you would place both of them into the same cell, and then leverage each via a visibility parameter by using the constant GONE in order to switch between one ViewGroup to the other ViewGroup (or View) from inside your Java code.

The DrawerLayout Class: Designing UI Drawer Layouts

package:android.support. v4.widget

android:layout_gravity

correspond to the side of the screen from which you want your UI Drawer to dragged out from

使用左右。而不能使用上下(Make absolutely sure not to use the TOP or BOTTOM (or any other constants) layout_gravity settings, as this class is not intended to provide vertical drawers, only horizontal ones, and will likely throw an exception.)

android:layout_height

match_parent

android:layout_width

you would next use the fixed width that you want to use for the UI Drawer width, specified using a DIP value

DrawerLayout.DrawerListener

Java code can do things when the drawer is open, closed, or being dragged.

onDrawerClosed()。onDrawerOpened(),onDrawerSlide(),onDrawerStateChanged()

STATE_IDLE

STATE_DRAGGING。STATE-SETTLING,LOCK_MODE_UNLOCKED,LOCK_MODE_LOCKED_OPEN,LOCK_MODE_LOCKED_CLOSED

DrawerLayout.SimpleDrawerListener

Adding Menu Items to Access the UI Layout Container

顺序(android:orderInCategory)

Creating a Table of Contents Activity for Your UI Design

Creating an XML Table of Contents LinearLayout UI Design

Adding Text UI Widgets to the TOC UI Layout Container

Using onOptionsItemSelected( ) to Add Menu Functionality

Testing the Table of Contents Activity on the Nexus One

《Pro Android Graphics》读书笔记之第六节的更多相关文章

  1. Android群英传》读书笔记 (3) 第六章 Android绘图机制与处理技巧 + 第七章 Android动画机制与使用技巧

    第六章 Android绘图机制与处理技巧 1.屏幕尺寸信息屏幕大小:屏幕对角线长度,单位“寸”:分辨率:手机屏幕像素点个数,例如720x1280分辨率:PPI(Pixels Per Inch):即DP ...

  2. 《Pro Android Graphics》读书笔记之第三节

    Android Frame Animation: XML, Concepts and Optimization Frame Animation Concepts: Cels, Framerate, a ...

  3. 《Pro Android Graphics》读书笔记之第四节

    Android Procedural Animation: : XML, Concepts and Optimization Procedural Animation Concepts: Tweens ...

  4. 《Pro Android Graphics》读书笔记之第二节

    Android Digital Video: Formats, Concepts and Optimization Android Digital Video Formats: MPEG4 H.264 ...

  5. 《Pro Android Graphics》读第三季度票据

    Android Frame Animation: XML, Concepts and Optimization Frame Animation Concepts: Cels, Framerate, a ...

  6. $《第一行代码:Android》读书笔记——第2章 Activity

    (一)创建活动 1.创建活动类 创建没有Activity的项目,发现src文件夹是空的,手动创建一个包com.jyj.demo1,在包中添加一个名为MainActivity的class,该MainAc ...

  7. $《第一行代码:Android》读书笔记——第1章 Android系统

    (一)Android系统架构 1.Linux内核层:各种底层驱动,如显示驱动.音频驱动.电源管理等. 2.系统运行库层:各种库支持,如3D绘图.浏览器内核.数据库等. 3.应用框架层:各种API,各种 ...

  8. $《第一行代码:Android》读书笔记——第3章 UI基础

    (一)Android常用控件及简单用法 1.如下图: 2.补充: (1)margin:外边距:padding:内边距. (2)gravity:子元素的位置:layout_gravity:子元素在父元素 ...

  9. $《第一行代码:Android》读书笔记——第10章 Android网络编程

    (一)WebView的用法 1.WebView也是一个普通的控件. 2.常用用法: WebView webView = (WebView)findViewById(R.id.web_view); we ...

随机推荐

  1. 如何运用GitHub来提高生产效率

    这是一篇GitHub的入门级文章,主要针对git的初学者.我们将讨论初学者最关心的一些问题,如:为什么我们要使用GitHub,它的应用有哪些,如何运用它去帮助我们提高工作效率,以及它的基本用法有哪些. ...

  2. linux 安装 Elasticsearch5.6.x 详细步骤以及问题解决方案

    在网上有很多那种ES步骤和问题的解决 方案的,不过没有一个详细的整合,和问题的梳理:我就想着闲暇之余,来记录一下自己安装的过程以及碰到的问题和心得:有什么不对的和问题希望及时拍砖. 第一步:环境 li ...

  3. Spring AOP高级——源码实现(1)动态代理技术

    在正式进入Spring AOP的源码实现前,我们需要准备一定的基础也就是面向切面编程的核心——动态代理. 动态代理实际上也是一种结构型的设计模式,JDK中已经为我们准备好了这种设计模式,不过这种JDK ...

  4. java中自动装箱带来的性能问题

    之前没有特别注意自动封装所带来的性能问题,今天看了effective java,实验了一下,结果大吃一惊: 考虑下面这段代码: public static void main(String args[ ...

  5. 为JS内置对象添加常用方法

    1.字符串全部替换: String.prototype.replaceAll = function(s1,s2){ return this.replace(new RegExp(s1,"gm ...

  6. js中的break,continue和return到底怎么用?

    为什么要说个?好像很简单,但是我也会迷糊,不懂有时候为什么要用return,然而break和continue也经常和他放在一起. 所以就一起来说一说,这三个看起来很简单,却常常会出错的关键词的具体用法 ...

  7. COBBLER无人值守安装

    cobbler-自动安装系统 1.1 cobber简介 1.1.1 cobbler说明 Cobbler是一个Linux服务器安装的服务,可以通过网络启动(PXE)的方式来快速安装.重装物理服务器和虚拟 ...

  8. linux操作系统基础篇(七)

    Linux服务篇(二) 1.nfs服务的搭建 安装: yum install rpcbind nfs-utils -y 配置: NFS服务的配置文件为 /etc/exports,这个文件是NFS的主要 ...

  9. JSON Web Tokens(JWT)

    现在API越来越流行,如何安全保护这些API? JSON Web Tokens(JWT)能提供基于JSON格式的安全认证.它有以下特点: JWT是跨不同语言的,JWT可以在 .NET, Python, ...

  10. Zuul(SpringCloud学习笔记一)

    路由是微服务架构中必须(integral )的一部分,比如,"/" 可能映射到你的WEB程序上,"/api/users "可能映射到你的用户服务上," ...