《Pro Android Graphics》读书笔记之第六节
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
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》读书笔记之第六节的更多相关文章
- Android群英传》读书笔记 (3) 第六章 Android绘图机制与处理技巧 + 第七章 Android动画机制与使用技巧
第六章 Android绘图机制与处理技巧 1.屏幕尺寸信息屏幕大小:屏幕对角线长度,单位“寸”:分辨率:手机屏幕像素点个数,例如720x1280分辨率:PPI(Pixels Per Inch):即DP ...
- 《Pro Android Graphics》读书笔记之第三节
Android Frame Animation: XML, Concepts and Optimization Frame Animation Concepts: Cels, Framerate, a ...
- 《Pro Android Graphics》读书笔记之第四节
Android Procedural Animation: : XML, Concepts and Optimization Procedural Animation Concepts: Tweens ...
- 《Pro Android Graphics》读书笔记之第二节
Android Digital Video: Formats, Concepts and Optimization Android Digital Video Formats: MPEG4 H.264 ...
- 《Pro Android Graphics》读第三季度票据
Android Frame Animation: XML, Concepts and Optimization Frame Animation Concepts: Cels, Framerate, a ...
- $《第一行代码:Android》读书笔记——第2章 Activity
(一)创建活动 1.创建活动类 创建没有Activity的项目,发现src文件夹是空的,手动创建一个包com.jyj.demo1,在包中添加一个名为MainActivity的class,该MainAc ...
- $《第一行代码:Android》读书笔记——第1章 Android系统
(一)Android系统架构 1.Linux内核层:各种底层驱动,如显示驱动.音频驱动.电源管理等. 2.系统运行库层:各种库支持,如3D绘图.浏览器内核.数据库等. 3.应用框架层:各种API,各种 ...
- $《第一行代码:Android》读书笔记——第3章 UI基础
(一)Android常用控件及简单用法 1.如下图: 2.补充: (1)margin:外边距:padding:内边距. (2)gravity:子元素的位置:layout_gravity:子元素在父元素 ...
- $《第一行代码:Android》读书笔记——第10章 Android网络编程
(一)WebView的用法 1.WebView也是一个普通的控件. 2.常用用法: WebView webView = (WebView)findViewById(R.id.web_view); we ...
随机推荐
- HTML学习笔记 基础表格案例 第二节 (原创) 参考使用表
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- vue实现仿淘宝结账页面
这个demo,是小颖基于之前的 vue2.0在table中实现全选和反选 文章进行更新后的demo,主要功能呢,是仿照淘宝页面的结算购物车商品时自动算出合计价格的页面,具体页面效果请看下面的动图: ...
- httpwebrequest 用GET方法时报无法发送具有此谓词类型的内容正文
如下一段小程序,运行结果报无法发送具有此谓词类型的内容正文的错误,其实原因很简单,因为用的是GET的方式进行提交,而GetRequestStream()是用来在post提交的时候写post的内容的流, ...
- 配置ssh免密码登陆
以root账户为例 准备两台以上的Linux服务器,我这里用的是s204,s205两台机器,多台同样的 先使用ssh登录试一下,如果没有安装则需要先安装一下 ssh s205会提示你输入密码 原理 ...
- C#实现的apache htpasswd加密
一.VisualSvn Server 这个软件大家都知道,具体使用时创建用户名密码和组时,每次都要登陆到VisualSvn Server所在的机器上,次次如此... 由于一些原因要把这个用户管理的功能 ...
- [转载] 红黑树(Red Black Tree)- 对于 JDK TreeMap的实现
转载自http://blog.csdn.net/yangjun2/article/details/6542321 介绍另一种平衡二叉树:红黑树(Red Black Tree),红黑树由Rudolf B ...
- [转]ORACLE SQL解析之硬解析和软解析
http://blog.chinaunix.net/uid-25909722-id-3363789.html 当客户端进程,将SQL语句通过监听器发送到Oracle时, 会触发一个Server pro ...
- phpcms实现全站搜索
如果制作的静态页面中有搜索功能,那么使用phpcms进行替换怎么替换呢?会不会越到很多的麻烦呢?接下来进行phpcms替换静态页面中的搜索功能. 第一步:搜索页面的form表单提交书写,form表单怎 ...
- 在网页标题栏title加入图标?
方法一:制作一个ico格式的图片,将图片命名为favicon.ico,像素大小为16*16,所使用的颜色不得超过16色,然后再把favicon.ico放到网站的根目录下就行了.这样的话浏览器会不停的搜 ...
- [最短路]P1119 灾后重建
题目背景 B地区在地震过后,所有村庄都造成了一定的损毁,而这场地震却没对公路造成什么影响.但是在村庄重建好之前,所有与未重建完成的村庄的公路均无法通车.换句话说,只有连接着两个重建完成的村庄的公路才能 ...