What is the difference between margin and padding in android?
Margin specifies the extra space left on all four sides of a view. Margin space is generally outside the view's bounds. To leave space on left side use android:margin_left, to leave space on other sides use android:layout_marginRight, android:layout_marginTop, android:layout_marginBottom etc..
Padding is used to offset the content of a view by specifying pixels. For example a left padding of 2 wil push views content 2 pixels right side of the left edge. Use android:padding
android:paddingTop to set padding on various sides of the content of that view.
both options are true
Margin is the offset for the content of the view, and padding is the space outside the view's bounds. Other wise both option 1 and option 2 are correct.
Back To Top