relativelayout Layout
This address: Http://blog.csdn.net/caroline_wendy
relativelayout is a relative layout method, which is aligned according to the attributes;A Layout where the positions of the children can be described in relation to each other or to the parent.in a layout, the position of the child controls is described in relation to each other. Note that you cannot has a circular dependency between the size of the relativelayout and the position of its childre N.there can be no circular dependencies between child controls.
Note: in platform version lower, Relativelayout is affected by a measurement bug that could cause Chi LD views to is measured with incorrect MEASURESPEC values. This is triggered when a relativelayout container is placed in a scrolling container, such as a ScrollView or horizontal ScrollView. If A custom view not equipped to properly measure with the Measurespec mode UNSPECIFIED is placed in a relativelayout, th Is would silently work anyway as relativelayout would pass a very large at_most measurespec instead.This behavior have been preserved for apps that set android:targetsdkversion= "+" or older in their manifest ' s USES-SDK tag for compatibility. Apps targeting SDK version or newer would receive the correct behavior
|
Property name |
Describe |
|
Android:layout_below |
Placed below the specified component |
|
Android:layout_toleftof |
Placed on the left side of the specified component |
|
Android:layout_torightof |
Placed on the right side of the specified component |
|
Android:layout_aligntop |
Align with the specified component as a reference |
|
Android:layout_algnbottom |
To align with the specified component as a reference |
|
Android:layout_alignleft |
Align left with the specified component as a reference |
|
Android:layout_alignright |
To specify the component |
android:layout_tostartof= "@+id/buttontweet"//table is aligned in front of a control, and if you do not know, drag on the graphical interface
<relativelayout xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:tools= "http// Schemas.android.com/tools "android:layout_width=" match_parent "android:layout_height=" Match_parent "Android:paddi ngleft= "@dimen/activity_horizontal_margin" android:paddingright= "@dimen/activity_horizontal_margin" Android: paddingtop= "@dimen/activity_vertical_margin" android:paddingbottom= "@dimen/activity_vertical_margin" tools: Context= ". Statusactivity "> <button android:layout_width=" wrap_content "android:layout_height=" Wrap_content " android:text= "@string/button_tweet" android:id= "@+id/buttontweet" android:layout_alignparentend= "true" /> <edittext android:layout_width= "wrap_content" android:layout_height= "Wrap_content" Androi D:inputtype= "Textmultiline" android:ems= "android:id=" @+id/edittext "Android:layout_alignparentbot" Tom= "true" android:layout_alignparentstart= "tRue "android:hint=" @string/hint_status "android:layout_tostartof=" @+id/buttontweet "/> <textview Android:id= "@+id/textcount" android:layout_width= "wrap_content" android:layout_height= "Wrap_content" android:layout_alignend= "@id/buttontweet" android:layout_below= "@id/buttontweet" android:text= "140" Android:textappearance= "? Android:textappearancesmall"/></relativelayout>
Android-relativelayout layout