The Android mobile phone operating system is compiled in the simulator to help us implement various functional requirements. Especially in the interface operations. Here, we can have an in-depth understanding of the Android interface layout operations.
- Android Timer Programming Method
- Android ListActivity full solution
- Android SDK
- Android power management related application skills
- Introduction to how to create an Android NDK Environment
I have been developing the iphone for the past. Now I want to add my interest to my work and turn it into Android development. Here, I want to learn about Android, so that I can find it somewhere in the future.
The interface is the most basic for applications, So I first studied how to create the Androidi interface. I thought it was very simple, just like other iphone and vc, the interface is the WYSIWYG mode. Later I saw that this was not the case .....
The andorid interface needs to be written in the xml of res/layout. Generally, the xml corresponds to an interface.
The layout of the Android interface is a bit like html (the method for writing comments code is the same). You must first set the Android framework and then place controls in the framework. Android provides several frameworks, AbsoluteLayout, linearLayout, RelativeLayout, TableLayout, FrameLayout
FrameLayout: there is only one control in it, and the position of the control cannot be designed. The control is placed in the upper left corner.
LinearLayout: Multiple controls can be placed, but only one control can be placed in one row.
TableLayout: this should be used with TableRow, much like the table in html
AbsoluteLayout
RelativeLayout: Multiple controls can be placed in the control, but the control positions are relative positions.
(The layout of the Android interface seems to be able to directly reference some views, such as ScrollView)
The xml of the Framework is as follows:
- Android:id="@+id/widget36"
- Android:layout_width="fill_parent"
- Android:layout_height="fill_parent"
- >
The above code starts with Android:, indicating the control property. fill_parent is the system's built-in parameter, indicating the maximum width or height. There is also a wrap_content, indicating the right width or height. In addition to the preceding three attributes, there are also some other attributes, such as Android: background = "# FF0000FF", which sets the background color of the framework, androidrientation = "vertical" is used to set the trend attributes in this framework.
The above is an introduction to the concept of Android interface layout.