《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 ...
随机推荐
- Oracle 11g服务器安装详细步骤——图文教程
1.大家可以根据自己的操作系统是多少位(32位或64位)的,到官网下载相应的安装程序,如下图所示. 有一点需要注意,Oracle的安装程序分成2个文件,下载后将2个文件解压到同一目录即可. 2.下载完 ...
- salesforce零基础学习(八十三)analytics:reportChart实现Dashboard(仪表盘)功能效果
项目中经常会用到Report以及Dashboard来分析汇总数据,Dashboard可以指定view as user,如果针对不同的用户需要显示其允许查看的数据,比如 根据role hierarch ...
- [转载] Java并发编程:Callable、Future和FutureTask
转载自http://www.cnblogs.com/dolphin0520/p/3949310.html 在前面的文章中我们讲述了创建线程的2种方式,一种是直接继承Thread,另外一种就是实现Run ...
- [转载] 使用 Twitter Storm 处理实时的大数据
转载自http://www.ibm.com/developerworks/cn/opensource/os-twitterstorm/ 流式处理大数据简介 Storm 是一个开源的.大数据处理系统,与 ...
- [转]查询 SQL Server 系统目录常见问题
查询 SQL Server 系统目录常见问题 http://msdn.microsoft.com/zh-cn/library/ms345522.aspx#_FAQ4 下列部分按类别列出常见问题. 数据 ...
- Python之Django环境搭建(MAC+pycharm+Django++postgreSQL)
Python之Django环境搭建(MAC+pycharm+Django++postgreSQL) 转载请注明地址:http://www.cnblogs.com/funnyzpc/p/7828614. ...
- YII2 models非常好用的控制输出数据【重写Fields】
models里重写Fields真的很好用,用于分类.评论功能 列子:评论表models/Comment.php 1.关联商品表 2.获取父级(即管理员)评论 public function Field ...
- Liunx文件解压与压缩
文件压缩和解压缩 常见压缩格式如下 .zip .gz .bz2 .tar.gz .tar.gz2 .zip压缩 zip 压缩文件名 源文件 压缩文件 zip -r(递归) 压缩文件名 源目录 压缩目录 ...
- markdown简述
前端开发的工具 编辑器: 1. 轻量级的,依靠插件:sublime:atom(github):vs code(miscrosaft) 2. 集成的:DW:webstorm:hbuild ...
- JDK8新特性一览
转载自:http://blog.csdn.net/qiubabin/article/details/70256683 官方新特性说明地址 Jdk8新特性.png 下面对几个常用的特性做下重点说明. 一 ...