博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
《Pro Android Graphics》读书笔记之第六节
阅读量:4655 次
发布时间:2019-06-09

本文共 4001 字,大约阅读时间需要 13 分钟。

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

转载于:https://www.cnblogs.com/zsychanpin/p/6917695.html

你可能感兴趣的文章
常用的CSS命名规则
查看>>
约数个数定理&约数和定理
查看>>
Oracle EBS数据定义移植工具:FNDLOAD
查看>>
判素数
查看>>
extjs4.1:两个combobox的联动
查看>>
百度地图瓦片工具:定义坐标
查看>>
jmeter控制器--交替控制器
查看>>
hdu 5365 Run
查看>>
[Angular] Configurable NgModules
查看>>
各种类型的段以及段中存储子句的优先级
查看>>
Json返回通用对象,工具类
查看>>
featurized image pyramids
查看>>
SQLHelper.cs
查看>>
JZOJ 4742. 单峰
查看>>
博弈论题目总结(三)——组合游戏进阶
查看>>
Flash AS3 踪迹效果 拖尾效果[转]
查看>>
MySQL5.7 查询用户,配置IP限制
查看>>
阻止继承的思路,屏蔽友元类
查看>>
详细的字符设备驱动
查看>>
动态规划算法--01背包问题
查看>>