8

See Attached below image I want to get rid of extra white space after +41 because the Mobiltelefonnummer text gets trim.

enter image description here

Tried adding android:padding="0dp" and android:marginStart="0dp" and also added below code:

public View getView(int position, View convertView, @NonNull ViewGroup parent) {
       View v = super.getView(position, convertView, parent);
       v.setPadding(0, v.getPaddingTop(), 0, v.getPaddingBottom());
       return v;
   }

The above code dint worked at all

//layout

<Spinner
        android:id="@+id/spinCode"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="8dp"/>

//textview.xml

<TextView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/simple_spinner_text_quantity"
    android:paddingTop="5dp"
    android:paddingBottom="5dp"
    android:paddingLeft="20dp"
    android:paddingRight="25dp"
    android:gravity="start"
    android:textAlignment="gravity"
    />
Aadit33
  • 192
  • 10

2 Answers2

0

Remove left-right padding from TextView or make it smaller, like 5dp.

Cătălin Florescu
  • 5,012
  • 1
  • 25
  • 36
0

Remove left padding and right padding from textview and your issue will be solved.

AIK
  • 498
  • 2
  • 6
  • 20