Transferred from: http://blog.csdn.net/yanfangjin/article/details/7393023
In the following XML configuration file, initially for Android:layout_marginbottom, you need to control ImageButton for the downward spacing, you cannot working.
<relativelayout
Android:id= "@+id/bar"
Android:layout_width= "Wrap_content"
android:layout_height= "Fill_parent"
android:background= "@drawable/IC_BAR_BG"
Android:layout_alignparentright= "true"
android:orientation= "Horizontal" >
<imagebutton
Android:id= "@+id/gallery"
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
Android:layout_centerhorizontal= "true"
Android:layout_marginbottom= "10DP"
android:background= "@drawable/ic_frame"/>
</RelativeLayout>
See a lot of blog, for releated layout of the settings have a certain understanding, subsequent testing, added the following settings android:layout_alignparentbottom= "True", you can use layout _marginbottom This feature so that the default setting is assumed, Alignparantbottom is definitely false, so layout_marginbottom does not work.
<relativelayout
android:id= "@+id/bar"
android:layout_width= "Wrap_content"
android:layout_height= "Fill_parent"
android:background= "@drawable /IC_BAR_BG "
android:layout_alignparentright=" true "
android:orientation= "Horizontal";
<imagebutton
Android:id= "@+id/gallery"
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
Android:layout_centerhorizontal= "true"
android:layout_alignparentbottom= "true"
Android:layout_marginbottom= "10DP"
android:background= "@drawable/ic_frame"/>
</RelativeLayout>
Android Layout XML attribute Research--android:layout_marginbottom (reprint)