views:

19

answers:

1
<View
  android:id="@+id/first_sep"
  android:layout_width="fill_parent"
  android:layout_height="1dip"
  android:paddingTop="100dip"
  android:layout_below="@id/calculate"
  android:background="#FFCCCCCC" />

I have this View in a RelativeLayout and the android:paddingTop property doesn't seem to work. Tried it with various values and still the View lies close to the Button "calculate".

+1  A: 

As MGS indicates, you probably want android:layout_marginTop, or perhaps android:layout_height=101dip. I am uncertain if padding has any meaning on a generic View. If it is supported, it certainly will have no difference than simply setting the height to include the padding, since padding is considered part of the background calcluations.

For space between a widget and an adjacent widget, use margins. For space between the edges of a widget and its contents (e.g., between the edge of a Button and its caption), use padding. In the case of a transparent background, these will visually be identical. In the case of a non-transparent background, they will be substantially different visually.

CommonsWare