Why my spinner customer bottom border transfer to right....

JunCainJunCain Member ✭✭✭

Why my spinner customer bottom border transfer to right when I select an item on spinner..

bottomBorder.xml

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
  <item android:bottom="3dp"
        android:left="-1dp"
        android:right="-5dp"
        android:top="-5dp">
    <shape android:shape="rectangle" >
      <stroke
          android:width="1dp"
          android:color="#252628" />
    </shape>
  </item>
</layer-list>

content_main.axml

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/mainLayout"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        tools:showIn="@layout/app_bar_main">
        <ScrollView
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:scrollbars="none"
            android:layout_weight="1">
            <LinearLayout
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:orientation="vertical">
                <TableLayout
                    android:background="@drawable/mainTableBorder"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:stretchColumns="*"
                    android:isScrollContainer="true">
                    <TableRow
                        android:layout_width="match_parent"
                        android:layout_height="match_parent">
                        <TextView
                            android:id="@+id/agent"
                            android:background="@drawable/bottomBorder"
                            android:paddingTop="15dp"
                            android:paddingLeft="10dp"
                            android:paddingBottom="10dp"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginLeft="5dp"/>
                        <TextView
                            android:id="@+id/dateNow"
                            android:background="@drawable/bottomRightBorder"
                            android:paddingTop="15dp"
                            android:paddingRight="10dp"
                            android:paddingBottom="10dp"
                            android:layout_marginRight="10dp"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="right"/>
                    </TableRow> 
                    <TableRow
                        android:layout_width="match_parent"
                        android:layout_height="match_parent">
                        <Spinner                                                     ////////// This spinner is the problem //////////////////////////////////
                            android:id="@+id/customer"
                            android:background="@drawable/bottomBorder"
                            android:paddingRight="10dp"
                            android:paddingBottom="5dp"
                            android:paddingTop="5dp"
                            android:textSize="6sp"
                            android:layout_marginLeft="5dp"
                            android:layout_width="wrap_content"
                            android:layout_height="40dp"
                            android:singleLine="true"/>
                        <TextView
                            android:id="@+id/prodCat"
                            android:background="@drawable/bottomRightBorder"
                            android:paddingTop="10dp"
                            android:paddingRight="10dp"
                            android:paddingLeft="10dp"
                            android:paddingBottom="12dp"
                            android:layout_marginRight="10dp"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="right"/>
                    </TableRow>
                </TableLayout>
                <TableLayout
                    android:id="@+id/parentTble"
                    android:background="@drawable/solidBorder"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:stretchColumns="*"
                    style="@style/TableMP"
                    android:isScrollContainer="true">
                    <TableRow
                        android:background="@drawable/tble_row_bg"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:padding="5dp">
                        <TextView
                            android:background="@drawable/tble_cell_bg"
                            android:layout_width="wrap_content"
                            android:layout_height="match_parent"
                            android:paddingLeft="10dp"
                            android:paddingRight="10dp"
                            android:paddingTop="5dp"
                            android:paddingBottom="5dp"
                            android:textColor="@drawable/myColors"
                            android:text="Product Name" />
                        <TextView
                            android:background="@drawable/tble_cell_bg"
                            android:layout_width="wrap_content"
                            android:layout_height="match_parent"
                            android:paddingLeft="10dp"
                            android:paddingRight="10dp"
                            android:paddingTop="5dp"
                            android:paddingBottom="5dp"
                            android:textColor="@drawable/myColors"
                            android:text="Unit" />
                        <TextView
                            android:background="@drawable/tble_cell_bg"
                            android:layout_width="wrap_content"
                            android:layout_height="match_parent"
                            android:paddingLeft="10dp"
                            android:paddingRight="10dp"
                            android:paddingTop="5dp"
                            android:paddingBottom="5dp"
                            android:textColor="@drawable/myColors"
                            android:text="Quantity"
                            android:layout_gravity="right"/>
                        <TextView
                            android:background="@drawable/tble_cell_bg"
                            android:layout_width="wrap_content"
                            android:layout_height="match_parent"
                            android:paddingRight="10dp"
                            android:paddingTop="5dp"
                            android:paddingBottom="5dp"
                            android:textColor="@drawable/myColors"
                            android:text="Price"
                            android:layout_gravity="right"/>
                    </TableRow>
                    <TableRow
                        android:id="@+id/scndtr"
                        android:background="@drawable/tble_row_bg">
                        <Spinner
                            android:id="@+id/prodName"
                            android:paddingRight="10dp"
                            android:background="@drawable/tble_cell_bg"
                            android:singleLine="true"
                            android:textColor="@drawable/myColors" />
                        <Spinner
                            android:id="@+id/prodUnit"
                            android:paddingRight="10dp"
                            android:background="@drawable/tble_cell_bg"
                            android:textColor="@drawable/myColors"
                            android:singleLine="true" />
                        <EditText
                            android:id="@+id/prodQty"
                            android:background="@drawable/tble_cell_bg"
                            android:inputType="number"
                            android:textSize="14sp"
                            android:hint="Quantity"
                            android:textColor="@drawable/myColors" />
                        <EditText
                            android:id="@+id/prodPrice"
                            android:background="@drawable/tble_cell_bg"
                            android:textSize="14sp"
                            android:inputType="number"
                            android:hint="Price"
                            android:textColor="@drawable/myColors" />
                    </TableRow>
                </TableLayout>
                <TableLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:stretchColumns="*"
                    style="@style/TableMP"
                    android:isScrollContainer="true">
                    <TableRow
                        android:layout_width="match_parent"
                        android:layout_height="match_parent">
                        <Button
                            android:id="@+id/btnGen"
                            android:textSize="14sp"
                            android:textColor="@drawable/myColors"
                            android:text="Generate fields"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content" />
                        <Button
                            android:id="@+id/btnRem"
                            android:textSize="14sp"
                            android:textColor="@drawable/myColors"
                            android:text="Remove fields"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content" />
                        <Button
                            android:id="@+id/btnSend"
                            android:textSize="14sp"
                            android:textColor="@drawable/myColors"
                            android:text="Send orders"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content" />
                    </TableRow>
                </TableLayout>
                 <TextView
                    android:id="@+id/display"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerInParent="true"
                    />
            </LinearLayout>
        </ScrollView>

    </RelativeLayout>

Answers

Sign In or Register to comment.