Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android reduce space between two vertical TextViews [duplicate]

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?

On image space between two text views-padding and margin are 0

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

like image 398
Jovan Avatar asked Aug 23 '11 14:08

Jovan


2 Answers

android:includeFontPadding="false"
like image 53
deviant Avatar answered Nov 09 '22 05:11

deviant


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

like image 21
vhd Avatar answered Nov 09 '22 04:11

vhd