How to remove the dividing line in the spinner?

How to remove the dividing line in the counter?

For example, how can I remove / manage these white dividing lines?

spinner

PS This is the line layout:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@android:color/black"> <TextView android:id="@+id/catalog_spinner_item_textView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="11dp" android:text="@string/CatalogSpinnerItemRowDefaultText" android:textSize="18sp" android:gravity="center_vertical"/> </LinearLayout> 
+6
source share
3 answers
 public View getView(int position, View row, ViewGroup container) { row=(View) inflater.inflate(R.layout.row_layout_spinner_filter, null); TextView tv=(TextView) row.findViewById(R.id.textview_spinner_filter_item_name); if(container!=null&&(container instanceof ListView)){ ListView lv=null; try{ lv=(ListView)container; }catch(Exception e){} if(lv!=null){ lv.setDivider(drawable); lv.setDividerHeight(height); } } tv.setText(getItem(position)); return row; } 

The ViewGroup container comes in the form of a ListView or Spinner, so you can intercept the list and edit the delimiter.

+1
source

use in Spinner xml

Android: = background "@ zero"

0
source

Define the style mentioned by Kunal, then refer to this style in your spinner as on android: style = ""

or you can use android: divider and android: dividerHeight in your counter to manage its attributes / delete them.

Or you can set the delimiter to android: color / transparent.

-1
source

All Articles