Unwanted padding in android - android

I have an imageview and textview in a LinearLayout with horizontal orientation. Do not know why the textview has a space on the left that I can not remove ...
I tested with padding, gravities, etc. ...
This is my xml and result in an image
Any idea?
Thank you!
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="left|center_vertical"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/dot" />
<TextView
android:id="#+id/text_resultado"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:gravity="center"
android:padding="3dp"
android:text="TextView"
android:textColor="#color/negroLetras"
android:textSize="#dimen/titles" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:paddingBottom="3dp"
android:paddingRight="3dp"
android:paddingTop="3dp"
android:text="%"
android:textColor="#color/negroLetras"
android:textSize="#dimen/titles" />
</LinearLayout>

Propably you have something wrong with you drawable "dot" or other values like dimen etc.
I think that because I used your code without this values with other sample values and layout was ok.

There is no problem in your code. Your code is perfect. May your problem be in image. Check it or replace it with other and then check it.

May i suggest you to change a little bit your layout?
Delete second LinearLayout and use a TextView like this:
<TextView
android:id="#+id/text_resultado"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableLeft="#drawable/dot"
android:fontFamily="sans-serif-light"
android:gravity="center"
android:padding="3dp"
android:text="TextView"
android:textColor="#color/negroLetras"
android:textSize="#dimen/titles" />

Related

How do I right justify a TextView in a Linear Layout?

I am trying to get the TextView, "tv_amount" to stay on the right side of the screen. I have tried using android:gravity="right" but that hasn't been working for me. Anyone have any suggestions?
Image of emulator running this code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="45dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="#+id/iv_icon"
android:layout_width="40sp"
android:layout_height="40sp"
android:background="#drawable/circle_border"
android:padding="6sp"
android:layout_marginLeft="6dp"
android:src="#drawable/food"/>
<TextView
android:id="#+id/tv_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginStart="12dp"
android:text="Yummy Pizza"
android:textSize="20sp" />
<TextView
android:id="#+id/tv_amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="12dp"
android:gravity="end"
android:text="$25"
android:textSize="25sp" />
</LinearLayout>
I am expecting the transaction or "tv_amount" to stay be right justified so that end of the number is staying towards the right side of the screen.
I tried using :
android:layout_weight="0"
android:layout_gravity="end"
android:gravity="right"
but these don't seem to work obviously. I am a beginner when it comes to android development and can't seem to find any answers that have helped anywhere else. They all say to use android:gravity or some other alternative. Maybe there is something in my code that doesn't allow that.
Try it like this:
Splitting the content into left and right will result in the weight and gravity properties working. Check out this layout below.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="#+id/tv_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Title"
android:textSize="20sp" />
<!--Separate layout aligned to the left, containing an image and a yummy pizza label. -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal">
<ImageView
android:id="#+id/iv_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView
android:id="#+id/tv_text_left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Text Left"
android:textSize="16sp" />
</LinearLayout>
<!--Display the pizza price on a separate label aligned to the right -->
<TextView
android:id="#+id/tv_text_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:text="Text Right"
android:layout_weight="1"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
I am dumb. The issue wasn't with the code in my individual recycler view layout code. It was with my activity_main.xml. I set the recycler_view width to "wrap_content" when it should have been "match_parent." Rookie mistake.

Relative Layout, align center of parent and right of view with no overlap

I am trying to align a TextView to be centered in a relative layout but also to the right of an ImageView. I would like it to look like this.
[-(image)-----some text here------------]
I'm able to do this with the code below, but if the text becomes too long it overlaps the image.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="#dimen/small_padding"
android:paddingBottom="#dimen/small_padding"
android:background="#color/White">
<ImageView
android:id="#+id/navMenu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/home_icon"
android:layout_marginEnd="#dimen/small_padding"
android:contentDescription="#string/abc_search_hint"
android:layout_alignParentStart="true" />
<TextView
android:id="#+id/actionBarTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/profile"
android:textSize="24sp"
android:textStyle="bold"
android:textColor="#color/Black"
android:maxLines="1"
android:ellipsize="end"
android:contentDescription="#string/title_activity_connect"
android:layout_centerInParent="true" />
</RelativeLayout>
I have tried aligning the TextView to the right of the ImageView but it stops centering in parent if I do that. Any help is appreciated
You could try something like this. I used a radio group instead of a linear layout for this but it should still work. Have a the linear layout horizontal as you already do and then make the layout gravity center then just put the image first then the text view
<RadioGroup
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center"
android:paddingTop="20dp">
<RadioButton
android:id="#+id/radio_student"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/checkbox_student"
android:onClick="onRadioButtonClicked"
android:layout_marginEnd="30dp"
android:layout_marginRight="30dp"/>
<RadioButton
android:id="#+id/radio_teacher"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/checkbox_teacher"
android:onClick="onRadioButtonClicked"
android:layout_marginStart="30dp"
android:layout_marginLeft="30dp"/>
</RadioGroup>
EDIT:
I don't know if the margin attributes for the buttons I have work on text views but padding left on the text might work
try this:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="#dimen/small_padding"
android:paddingBottom="#dimen/small_padding"
android:background="#color/White">
<ImageView
android:id="#+id/navMenu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/home_icon"
android:layout_marginEnd="#dimen/small_padding"
android:contentDescription="#string/abc_search_hint"
android:layout_alignParentStart="`enter code here`true" />
<TextView
android:id="#+id/actionBarTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/profile"
android:textSize="24sp"
android:textStyle="bold"
android:textColor="#color/Black"
android:maxLines="1"
android:ellipsize="end"
android:contentDescription="#string/title_activity_connect"
android:layout_toRightOf="#+id/navMenu"
android:alignParentRight="true"
android:gravity="center" />
</RelativeLayout>
You could (and should, for performance sake), use a compound drawable for the TextView (and get rid of the ImageView)
You want the image to stay on the Left part of the TextView, so use android:drawableLeft:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="#dimen/small_padding"
android:paddingBottom="#dimen/small_padding"
android:background="#color/White"
>
<TextView
android:id="#+id/actionBarTitle"
android:drawableLeft="#drawable/home_icon"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="#string/profile"
android:textSize="24sp"
android:textStyle="bold"
android:textColor="#color/Black"
android:maxLines="1"
android:ellipsize="end"
android:contentDescription="#string/title_activity_connect"
android:centerInParent="true"
android:gravity="center"
/>
</RelativeLayout>

TextView showing very small in the screen

In my app I have the following layout, and no matter what value I give the textview doesn't change its width. Can someone please help me in correcting this layout.
Here is the XML code:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:layout_marginTop="15dp"
android:descendantFocusability="blocksDescendants" >
<TableRow
android:layout_width="match_parent"
android:gravity="center_horizontal" >
<TextView
android:id="#+id/rec_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/fill_rece"
android:ems="10"
android:focusable="false"
android:padding="10dp"
android:textColor="#FFFFFF" />
<ImageButton
android:id="#+id/btn_rec_delete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="#string/content"
android:src="#drawable/ipad_postcare_landscape_from" />
</TableRow>
</TableLayout>
I also get a warning near TableRow saying "This TableRow layout or its TableLayout parent is useless". Please guide me.
Thanks in advance.
Try this one Insted of table use Linear Layout with and set LAYOUT_WEIGHT property. This property shares the equal amount of space for text view and image button
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<TextView
android:id="#+id/rec_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#drawable/fill_rece"
android:focusable="false"
android:padding="10dp"
android:textColor="#FFFFFF" />
<ImageButton
android:id="#+id/btn_rec_delete"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:contentDescription="#string/content"
android:src="#drawable/ipad_postcare_landscape_from" />
</LinearLayout>
try this....,you can add android:textSize="some value" which you want t o give
<TextView
android:id="#+id/rec_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="false"
android:padding="10dp"
android:text="hllo"
android:textSize="25dp" />
You might need to use
android:layout_weight
I am mentioning one example for your help, also make sure your every element has height and weight with it, to display everything correctly
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="#drawable/layout_border"
android:weightSum="1.0"
android:id="#+id/r1c1r2">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:textIsSelectable="true"
android:id="#+id/key"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:textIsSelectable="true"
android:id="#+id/key2" />
</LinearLayout>
Give the textsize using:
android:textSize="some value"
try to give size according to your requirement you have the width of the table row and textview set as match_parent hence it(textview) can't change it's size.
android:layout_width="50dp"

fill parent on a textview doesn't apply

I know this question has been asked multiple times, but I have looked on all the solution I could see and none of them worked.
I have a textview inside a relative-layout. the textview has a height : fill_parent atribute that does not work. the pun is that they are severall other textview in this relative-layoutwhich all manage to fill parent,except for this one.
here is the XML :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#drawable/customshape"
android:orientation="horizontal" >
<TextView
android:id="#+id/mainlistdescription"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:scrollHorizontally="true"
android:maxLines="4"
android:layout_alignParentLeft="true"
android:layout_toLeftOf="#+id/mainlistquantite"
android:layout_gravity="center_vertical"
android:textSize="12sp"
android:padding="10dp"
/>
<TextView
android:id="#+id/mainlistquantite"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:maxLines="4"
android:layout_toLeftOf="#+id/consultaffichelayoutdroit"
android:textSize="12sp"
android:padding="10dp"
/>
<TextView
android:id="#+id/consultafficheseparator" <!-- the one not working-->
android:layout_width="2dp"
android:layout_height="fill_parent"
android:layout_toLeftOf="#+id/imageView1"
android:background="#777777"
android:maxWidth="2dp" />
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="15dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:gravity="center_vertical|right"
android:src="#drawable/fleche" />
<LinearLayout
android:id="#+id/consultaffichelayoutdroit"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_toLeftOf="#+id/consultafficheseparator"
android:orientation="vertical"
android:paddingLeft="5dp"
>
<TextView
android:id="#+id/mainlistnumero"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_gravity="right"
android:layout_marginRight="10dp"
android:layout_weight="1"
android:textSize="12sp"
android:textStyle="bold" />
<TextView
android:id="#+id/mainlistprix"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_gravity="right"
android:layout_marginRight="10dp"
android:layout_weight="1" />
</LinearLayout>
</RelativeLayout>
here is what i get :
the grey bar should go all the way but doesn't when actually running on the emulator( it does in the eclipse tool)
since this xml is actually called in a list view, I can't seem to fix the problem using JAVA code, so the solution would ideally be on the XML file. I tryed so far android:clipChildren="false" without sucess, as well as changing the order of my elements in the XML, wich juste made it worse.
after experiment,I can tell nothing takes the place so it's not the it cannot go because there is allready a view there,it just doesn't expand that far
thanks for the help on that
Why are you using a TextView to draw a separator? Try with a normal view like the code below.
Also, if the seperator has to align to the bottom of your description view, you can use the layout_alignBottom-property of RelativeLayout like this:
android:layout_alignBottom="#+id/mainlistdescription"
So the separator would look something like the code below:
<View
android:id="#+id/consultafficheseparator"
android:layout_width="2dp"
android:layout_height="match_parent"
android:layout_toLeftOf="#+id/imageView1"
android:layout_alignBottom="#+id/mainlistdescription"
android:background="#color/separator_bg" />
Below some other tips:
It's better to define a color in some resource-file (eg. colors.xml) and refer to that color from inside your layout. Especially when using it in a ListView
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="separator_bg">#777777</color>
</resources>
And in your layout-file android:background="#color/separator_bg"
Use match_parent instead of fill_parent because that's deprecated.
I see android:scrollHorizontally="true" on one of the TextView's. That only works when the TextView is editable. If you want the content to scroll because it doesn't fit in the TextView, try to use the code below:
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
And in your adapter.getView():
final TextView description = (TextView) view.findViewById(R.id.mainlistdescription);
description.setSelected(true);
It looks like your TextView is not at the top level, maybe you can try the following in your code:
consultafficheseparatorTextView.bringToFront();
Had the same pesky problem which by the way makes no sense. What worked for me in the end was changing the android:layout_height in RelativeLayout tag to fill_parent like this
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#drawable/customshape"
android:orientation="horizontal">
hope this helps
Try setting one (or all) of the following to see if it changes anything:
android:maxHeight="100dp"
or
android:layout_height="100dp"
or
android:text="a"
android:textColor="#777777"
If any of these options change the size, please let me know and we can work on a proper solution!
It's very strange you get such view of this layout, because after copy&paste of your layout code I've got this one.
Your solution works, I've made some minor improvments. It's like your code, but there is no need to use TextView if you need background color only, View could be used instead.
<View
android:id="#+id/consultafficheseparator"
android:layout_width="2dp"
android:layout_height="match_parent"
android:layout_toLeftOf="#+id/imageView1"
android:background="#777777"
/>
Only suggestion is to set root layout height "match_parent" or some value in dp, like thiagolr proposed. I've set it to "100dp" for this screenshot.
This is what you should do,
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#drawable/customshape"
android:orientation="horizontal" >
<TextView
android:id="#+id/mainlistdescription"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:scrollHorizontally="true"
android:maxLines="4"
android:layout_alignParentLeft="true"
android:layout_toLeftOf="#+id/mainlistquantite"
android:layout_gravity="center_vertical"
android:textSize="12sp"
android:padding="10dp"
/>
<TextView
android:id="#+id/mainlistquantite"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:maxLines="4"
android:layout_toLeftOf="#+id/consultaffichelayoutdroit"
android:textSize="12sp"
android:padding="10dp"
/>
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="15dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:gravity="center_vertical|right"
android:src="#drawable/fleche" />
<TextView
android:id="#+id/consultafficheseparator" <!-- this will work now -->
android:layout_width="2dp"
android:layout_height="fill_parent"
android:layout_toLeftOf="#+id/imageView1"
android:background="#777777"
android:maxWidth="2dp" />
<LinearLayout
android:id="#+id/consultaffichelayoutdroit"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_toLeftOf="#+id/consultafficheseparator"
android:orientation="vertical"
android:paddingLeft="5dp"
>
<TextView
android:id="#+id/mainlistnumero"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_gravity="right"
android:layout_marginRight="10dp"
android:layout_weight="1"
android:textSize="12sp"
android:textStyle="bold" />
<TextView
android:id="#+id/mainlistprix"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_gravity="right"
android:layout_marginRight="10dp"
android:layout_weight="1" />
</LinearLayout>
</RelativeLayout>
1)Try to make your Linear Layout orientation vertical
or
2)Try to make your Relative Layout orientation vertical
it can be help.

Why does my spinner not look like a spinner?

I have a spinner that looks like extremly ugly like this:
When I click on it looks a little bit better:
But still, in the default it doesn't even looks like a spinner. Any idea how can I improve its looks?
Here is the code:
adapter=new SpinAdapter(this,com.Orange.R.layout.spinnerrowlist,spinnerInfo);
adapter.setDropDownViewResource(com.Orange.R.layout.multiline_spinner_dropdown_item);
previousVisitCommentsSpinner.setAdapter(adapter);
spinnerrowlist.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#FFFFFF"
android:orientation="horizontal" >
<TextView
android:id="#+id/textview_spinner1"
style="?android:attr/spinnerItemStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:layout_alignParentLeft="true"
android:textColor="#drawable/textorange_selected" />
<TextView
android:id="#+id/textview_spinner2"
style="?android:attr/spinnerItemStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_toRightOf="#+id/textview_spinner1"
android:paddingLeft="5dp"
android:textColor="#drawable/textorange_selected" />
<TextView
android:id="#+id/textview_spinner3"
style="?android:attr/spinnerItemStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:paddingLeft="5dp"
android:textColor="#drawable/textorange_selected" />
</RelativeLayout>
And here is the spinner:
<Spinner
android:id="#+id/previousVisitComments"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_below="#+id/previousvisit"
android:layout_marginTop="15dp"
android:background="#drawable/spinner_selector"
android:textColor="#color/medium_orange"
android:textAppearance="?android:attr/textAppearanceMedium"
/>
The items in the spinner should be on the same line, that's why I use a horizontal layout!
Thank you for your answers!
try adding this
android:layout_toRightOf="#+id/textview_spinner1
and you can also add the following just to see if it makes a difference
android:layout_below
and let me know how it goes :)
The items in the spinner should be on the same line, that's why I use a horizontal layout!
The problem is that you are trying to squeeze a lot of text into a narrow area. However you have two options:
First using what you have, simply add the layout_toLeftOf attribute to textview_spinner2:
<TextView
android:id="#+id/textview_spinner2"
style="?android:attr/spinnerItemStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_toLeftOf="#+id/textview_spinner3"
android:layout_toRightOf="#+id/textview_spinner1"
android:paddingLeft="5dp" />
Also you said that you are using a horizontal layout but a RelativeLayout does not have the attribute orientation, so this line does nothing:
android:orientation="horizontal"
The organization of the child elements is determined by individual attributes like: layout_toLeftOf, layout_toRightOf, layout_above, etc.
Second if you a RelativeLayout behaves in unruly ways and you have a simple layout like this, you can always switch to a LinearLayout:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp" >
<TextView
android:id="#+id/textview_spinner1"
style="?android:attr/spinnerItemStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:textColor="#drawable/textorange_selected" />
<TextView
android:id="#+id/textview_spinner2"
style="?android:attr/spinnerItemStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingLeft="5dp"
android:textColor="#drawable/textorange_selected" />
<TextView
android:id="#+id/textview_spinner3"
style="?android:attr/spinnerItemStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:paddingLeft="5dp"
android:textColor="#drawable/textorange_selected" />
</LinearLayout>
Now none of the columns in your Spinner overlap.
You could try (android.R.layout.simple_spinner_dropdown_item) in your Java code. Instead of this (com.Orange.R.layout.multiline_spinner_dropdown_item) Hope this helps.

Categories

Resources