android reduce space between two vertical TextViews
android, android-layout
Solution
Negative Margins can be set by two methods -
1) by xml - set the "android:Layout_marginTop" field negative - which other people have already suggested above
2) by java (Programmatically) - set the "topMargin" field of LayoutParams to negative.
You can also refer to this
Problem
I have two vertical TextView elements in my app. There is lot of space between TextViews, pading and layoutMargin are 0 Is there way to reduce this space? EDIT Here is my code: ``` . . <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" android:gravity="right" android:paddingRight="10dp" android:layout_weight="1"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="@dimen/text_size_extra_small" android:textColor="@color/home_tab_text_normal" android:text="Test1"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="@color/orange_text_color" android:textSize="@dimen/text_size_large" android:textStyle="bold" android:text="Text2"/> </LinearLayout> . . ``` Thnaks