How to remove the separator line in the spinner?
For example, how can I remove/control these white separator lines?
P.S. This is the row 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>
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;
}
ViewGroup container comes as ListView or Spinner, so you can catch listview and edit divider.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With