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. Jenkins TFS配置

    1. 在Jenkins中安装TFS插件 2. 在Build Server上安装tfs客户端程序,用来访问代码服务器获取代码, 这一部是由TFS Anywhere完成的 下载TFS Anywhere h ...

  2. 【5】namenode启动过程

    1.格式化空间(第一次启动的操作): 命令:bin/hadoop -format //用于格式化HDFS,如果不是首次格式化,需要删除下面配置的tmp目录后再进行core-site.xml的配置: / ...

  3. Oracle 存储过程的导出导入序列的导出

    昨天发布网站,需要将oracle的存储过程导出来,再在新的电脑加上去.登陆—>工具—>导出用户对象—>选取需要导出的存储过程—>导出 保存格式为.sql.当然利用该种方法也可以 ...

  4. Thrift全面介绍

    官网:http://thrift.apache.org   简介 Thrift是一个软件框架,用来进行可扩展且跨语言的服务的开发.它结合了功能强大的软件堆栈和代码生成引擎,以构建在 C++, Java ...

  5. Files and Directories

    Files and Directories Introduction     In the previous chapter we coveredthe basic functions that pe ...

  6. 基于BroadReceiver实现获取短信内容

    我朋友拜托我做一个能实现向指定号码发短信获取动态密码的一个小app,中间用到了基于监听系统通知的BroadReceiver 来实现获取有新短信并且获取新短信的内容.下面就是这个小app的实现监听部分的 ...

  7. 【YFMemoryLeakDetector】人人都能理解的 iOS 内存泄露检测工具类

    背景 即使到今天,iOS 应用的内存泄露检测,仍然是一个很重要的主题.我在一年前,项目中随手写过一个简单的工具类,当时的确解决了大问题.视图和控制器相关的内存泄露,几乎都不存在了.后来想着一直就那个工 ...

  8. 移动应用开发者最应该知道的8款SDK

    2017年双11全球狂欢节结束后,据大数据公司统计显示,2017年双11全网销售额达2539.7亿,移动端销售占比91.2%.不难看出,智能手机因随身携带.时刻在线等特点,已取代PC,成为网络生活新的 ...

  9. 《Metasploit魔鬼训练营》第四章(下)

    p163 XSSF 默认kali 2.0中没有xssf,先下载:https://code.google.com/archive/p/xssf/downloads 将下载下来的zip文件解压,将其中的d ...

  10. 在ERP中定义用户时报错:SqlDateTime 溢出。必须介于 1/1/1753 12:00:00 AM 和 12/31/9999 11:59:59 PM 之间

    在ERP中定义用户时.   报错: SqlDateTime 溢出.必须介于 1/1/1753 12:00:00 AM 和 12/31/9999 11:59:59 PM 之间. 原因分析: ①没有正确初 ...