Spacing between elements in LinearLayout

by Rohit » Fri, 06 Mar 2009 07:14:26 GMT


Sponsored Links
 How do I reduce the spacing between the elements in a linear layout?
I tried to set the padding to 0 as well as the vertical spacing but
that didnt seem to help. I want the textview and the imageview to be
flush together with no space between them. The following is my XML
layout file but I dont acheive what I want with it.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android=" http://schemas.android.com/apk/res/ 
android"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:padding="0px"
        android:verticalSpacing="0px"
        android:gravity="center"
        >

        <ImageView android:id="@+id/imageid"
                           android:layout_width="107px"
                           android:layout_height="100px"
                           android:gravity="center"
                           android:padding="0px"
                           android:verticalSpacing="0px"
                           />

        <TextView android:id="@+id/textid"
                          android:layout_width="107px"
                          android:layout_height="25px"
                          android:background="#c3c3c3"
                          android:textColor="#000000"
                          android:shadowColor="#ffffff"
                          android:shadowRadius="3"
                          android:gravity="center"
                          android:padding="0px"
                         android:verticalSpacing="0px"
                      />

</LinearLayout>


--~--~---------~--~----~------------~-------~--~----~



Spacing between elements in LinearLayout

by Rohit » Fri, 06 Mar 2009 07:15:51 GMT


 Somehow the shadow on the text also doesnt show up..

Rohit




--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Spacing between elements in LinearLayout

by Rohit » Fri, 06 Mar 2009 07:30:37 GMT


 This works - I was making some mistake in my code. The shadow still
doesnt work

Rohit





--~--~---------~--~----~------------~-------~--~----~



Spacing between elements in LinearLayout

by Rohit Mordani » Sat, 07 Mar 2009 10:59:55 GMT


 How do I reduce the spacing between the elements in a linear layout?
I tried to set the padding to 0 as well as the vertical spacing but
that didnt seem to help. I want the textview and the imageview to be
flush together with no space between them. The following is my XML
layout file but I dont acheive what I want with it.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android=" http://schemas.android.com/apk/res/ 
android"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:padding="0px"
        android:verticalSpacing="0px"
        android:gravity="center"
        >

        <ImageView android:id="@+id/imageid"
                           android:layout_width="107px"
                           android:layout_height="100px"
                           android:gravity="center"
                           android:padding="0px"
                           android:verticalSpacing="0px"
                           />

        <TextView android:id="@+id/textid"
                          android:layout_width="107px"
                          android:layout_height="25px"
                          android:background="#c3c3c3"
                          android:textColor="#000000"
                          android:shadowColor="#ffffff"
                          android:shadowRadius="3"
                          android:gravity="center"
                          android:padding="0px"
                         android:verticalSpacing="0px"
                      />

</LinearLayout>


--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Smarter Monkey Needed

I was testing my program with Monkey under the 1.5 emulator.   It gets 
hung up on some of the dialogs which a user would just dismiss with the 
back key and quits with a "not responding" error.  The application 
hasn't quit and dismissing the dialog the program continues to run 
normally.  This will also happen with any of the edit dialogs that the 
SoftKeyboard pops up during entry.  Soemtimes it will manage to dismiss 
a dialog.  I don't see anything in the options to prevent this.

Brian Conrad
JyotishTools.com


--~--~---------~--~----~------------~-------~--~----~

2. How to make SMS composing UI same Like Default.

Hi,

   I am trying to make user interface same like default sms composing
ui screen  but unable to make same like that.
any one can share xml with me if he/she have developed or give me any
idea how to do it.

Thanks in advance,

Gulfam
--~--~---------~--~----~------------~-------~--~----~

3. How to use setOnItemClickListener ?

4. Android OS Modification

5. how to stick two buttons together?

6. Why is Bitmap.Config.ARGB_4444 so slow to draw?

7. How to make games faster? Using view and redraw is way to slow it seems.