The progress of human science and technology comes from exploration. The exploration comes from the original discovery. Of course, the App layout is not so advanced. This article is just a summary.
This article is a must-have knowledge for android Developers. It is specially compiled and summarized for everyone. It is not perfect but useful.
Android interface development has a lot of similar or similar la S. In addition, looking at the Android application interface, there is always no way to escape those familiar structures.
Today, based on my experience, I have analyzed common la S and summarized several simple models. These models are generally the best layout for solving their corresponding layout problems, it depends on the situation.
Due to the limitation of my work, I cannot study the layout of the arms. I can only consider the layout I encountered during my work.
Another point I want to emphasize is that these layout principles are simple and flexible.
Model 1: horizontal three-column sitting
:
Note: There are three horizontal columns, with the buttons "return" and "Submit" on both sides. The buttons must be centered in the middle and generally contain the title name.
It seems that the background of the title contains two beautiful buttons.
Method: FrameLayout layout is used.
Material:
,
Layout code:
Html # viewSource "commandName =" viewSource "highlighterId =" highlighter_174070 "> view sourceprint?
02 |
The disadvantage is that the title can only contain a few words, and when there are more words, it will open and overlap with the buttons on both sides. |
03 |
The advantage is that the Code is concise. --> |
04 |
<? xml version = "1.0" encoding = "utf-8" ?> |
05 |
< FrameLayout xmlns:android = "http://schemas.android.com/apk/res/android" |
06 |
android:layout_width = "fill_parent" |
07 |
android:layout_height = "wrap_content" |
08 |
android:background = "@drawable/layout01_bg" |
09 |
android:paddingLeft = "10dip" |
10 |
android:paddingRight = "10dip" |
12 |
< Button android:layout_gravity = "left|center_vertical" |
13 |
android:layout_width = "wrap_content" |
14 |
android:layout_height = "wrap_content" |
15 |
android:background = "@drawable/layout01_tool" |