《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筆記
- 《Pro Android Graphics》讀書筆記之第三節Android筆記
- 《Pro Android Graphics》讀書筆記之第四節Android筆記
- 《Pro Android Graphics》讀書筆記之第五節Android筆記
- 《Pro Android Graphics》讀書筆記之第二節Android筆記
- 讀書筆記之五筆記
- 《IDA Pro權威指南》讀書筆記筆記
- JVM讀書筆記之OOMJVM筆記OOM
- 浪潮之巔讀書筆記筆記
- 星白贈書之讀書筆記(1)筆記
- 《Maven實戰》之讀書筆記Maven筆記
- 《瞬間之美》讀書筆記筆記
- 讀書筆記之MV_DM筆記
- MySQL 8.0 Reference Manual(讀書筆記90節--Replication)MySql筆記
- JVM讀書筆記之記憶體管理JVM筆記記憶體
- 讀書筆記...筆記
- 讀書筆記筆記
- 《讀書與做人》讀書筆記筆記
- 《數學之美》讀書筆記&思考筆記
- 深度學習讀書筆記之RBM深度學習筆記
- 《sed & awk》讀書筆記之 awk 篇筆記
- MySQL 8.0 Reference Manual(讀書筆記64節--InnoDBTransaction Model)MySql筆記
- MySQL 8.0 Reference Manual(讀書筆記65節--InnoDBLocks Set)MySql筆記BloC
- MySQL 8.0 Reference Manual(讀書筆記68節--Deadlocks)MySql筆記
- MySQL 8.0 Reference Manual(讀書筆記91節--Replication(2))MySql筆記
- MySQL 8.0 Reference Manual(讀書筆記92節--Replication(3))MySql筆記
- MySQL 8.0 Reference Manual(讀書筆記93節--Semisynchronous Replication)MySql筆記
- MySQL 8.0 Reference Manual(讀書筆記94節--Replication(5))MySql筆記
- MySQL 8.0 Reference Manual(讀書筆記45節--Optimization Overview)MySql筆記View
- Cucumber讀書筆記筆記
- 散文讀書筆記筆記
- HTTP 讀書筆記HTTP筆記
- CoreJava讀書筆記-------Java筆記
- flask讀書筆記Flask筆記
- Vue讀書筆記Vue筆記
- MONGODB 讀書筆記MongoDB筆記
- Qt讀書筆記QT筆記
- Node讀書筆記筆記