Neil
Neil

Reputation: 301

Leave blank line in Linear Layout

I am developing for android. The app is designed in XML in Linear Layout. What I want to do is to leave some blank lines between the consecutive buttons/text to ensure some neatness in the GUI. Is it posible to do it in Linear Layout? Please help...

Upvotes: 1

Views: 3358

Answers (2)

Abhishek V
Abhishek V

Reputation: 12526

If you want to leave space outside the border of text/button and next view elements you can use android:layout_marginLeft, android:layout_marginRight, android:layout_marginTop and android:layout_marginBottom.

If you want to leave space between border of the text/button and actual content of the text/button you can use android:paddingLeft, android:paddingRight, android:paddingTop and android:paddingBottom.

For more info check out this question how to increase the space between the elements in linearlayout in android?

Upvotes: 2

Booger
Booger

Reputation: 18725

You should use margins to seperate different components in your layout. An example of how this would look in your XML is: android:layout_marginTop="12dp"

Upvotes: 5

Related Questions