Why is it that sometimes variables such as android:layout_marginbottom are assigned negative values?
For example, the following code:
<?xml version="1.0"encoding="UTF-8"? ><linearlayout
android:orientation="Vertical"
Android:id="@id/widget_2x4_frame"
Android:layout_width="fill_parent"
android:layout_height="228.0dip"
android:layout_margintop="10.0dip"xmlns:android="http://schemas.android.com/apk/res/android"> <imageview
Android:layout_width="fill_parent"
android:layout_height="46.0dip"
Android:layout_marginbottom="-1.0dip"
Android:src="@drawable/widget_header"/> <include layout="@layout/widget_top"/> <include layout="@layout/widget_bottom"/></linearlayout>
Answer: MarginBottom positive value increases the distance from the space below, and negative values reduce the distance.
For example, your device resolution is 480x800, inside put a textview margintop is -50dip, then your textview will show the limited display range of the top 50dip location, on your device you can not see. View puts it in a stack sequence.
For example, the value of Android:layout_marginbottom is negative