《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 ...
随机推荐
- Web桌面应用框架3:Web桌面应用开发的N种Style
研究Web桌面应用开发有一段时间了,总结了Web桌面应用开发的一些主流方式. 一.前端Style 这种方式的就是直接实现一个Web程序,再封装一个浏览器展示,相当粗暴和有效.著名的框架就是Electr ...
- app.config 配置多项 配置集合 自定义配置(3)
再说说利用app.config配置多个自定义的方法.先看这个例子:美国家庭Simpson的家里有父亲母亲和三个儿女,而中国的老王只有独生子女.结构如下: <?xml version=" ...
- app.config 配置多项 配置集合 自定义配置
C#程序的配置文件,使用的最多的是appSettings 下的<add key="Interval" value="30"/>,这种配置单项的很方便 ...
- [转载] 使用Redis的Java客户端Jedis
转载自http://aofengblog.blog.163.com/blog/static/631702120147298317919/ 在实际的项目开发中,各种语言是使用Redis的客户端库来与Re ...
- 记录一下通过分析Tomcat内部jar包找出request.getReader()所用的字符编码在哪里设置和起效的完整分析流程
前言: 之前写Java服务端处理POST请求时遇到了请求体转换成字符流所用编码来源的疑惑,在doPost方法里通过request.getReader()获取的BufferedReader对象内部的 R ...
- 【YFMemoryLeakDetector】人人都能理解的 iOS 内存泄露检测工具类
背景 即使到今天,iOS 应用的内存泄露检测,仍然是一个很重要的主题.我在一年前,项目中随手写过一个简单的工具类,当时的确解决了大问题.视图和控制器相关的内存泄露,几乎都不存在了.后来想着一直就那个工 ...
- 下一个计划 : .NET/.NET Core应用性能管理系统
前言 最近几个月一直在研究开源的APM和监控方案,并对比使用了Zipkin,CAT,Sky-walking,PinPoint(仅对比,未实际部署),Elastic APM,TICK Stack,Pro ...
- Python 学习之路3
接下来把剩下的实验一起写上去 实验2 写一个学生类,属性有学号,姓名,成绩(三门),方法有输出,求平均成绩. 设计思路: 1. 先写一个学生类,并向里面写一个求平均值和输出信息的方法. ...
- 条件随机场 Conditional Random Fields
简介 假设你有冠西哥一天生活中的照片(这些照片是按时间排好序的),然后你很无聊的想给每张照片打标签(Tag),比如这张是冠西哥在吃饭,那张是冠西哥在睡觉,那么你该怎么做呢? 一种方法是不管这些照片的序 ...
- border-radio属性
boreder-radio属性是css3的新增属性,可以设置圆角的边框. <head> <style type="text/css"> *{ margin ...