android - What could this empty spacing under my listview item be? -
i extended arrayadapter inflate own custom layout (it doesn't else , implementation straightforward). noticed there's hairline of empty space between listview items:
https://www.evernote.com/l/am8w6ffsaqhgnjreixsy5fowdbztel7z73e
i've tried setting height of listview item opposed using wrap_content
, there's no margin anywhere, , i'm setting background color of root view of listview item i'm having hard time trying figure out why empty space being added.
@override public view getview(int position, view convertview, viewgroup parent) { viewholder holder; if (convertview == null) { convertview = minflater.inflate(r.layout.event_row, parent, false); holder = new viewholder(); holder.time = (textview) convertview.findviewbyid(r.id.clock_event_time); holder.title = (textview) convertview.findviewbyid(r.id.clock_event_title); convertview.settag(holder); } else { holder = (viewholder) convertview.gettag(); } clockevent clockevent = mclockevents.get(position); holder.time.settext( clockutil.halfhourindextohourstring(clockevent.getstarthalfhourindex()) + " - " + clockutil.halfhourindextohourstring(clockevent.getendhalfhourindex()) ); holder.title.settext(clockevent.gettitle()); convertview.setbackgroundcolor(clockevent.getcolor()); return convertview; }
and here's xml:
<?xml version="1.0" encoding="utf-8"?> <linearlayout 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:orientation="horizontal" android:background="@color/flatui_blue_1" android:padding="12dp" android:layout_width="match_parent" android:layout_height="60dp" android:gravity="center_vertical"> <com.compscieddy.foraday.ui.foradaytextview android:id="@+id/clock_event_time" android:layout_height="wrap_content" android:background="@drawable/rounded_white_outline" app:fontface="montserrat_light" android:paddingtop="2dp" android:paddingbottom="2dp" tools:text="7:00 - 8:00" android:textsize="11sp" style="@style/eventtimetextview"/> <com.compscieddy.foraday.ui.foradaytextview android:id="@+id/clock_event_title" android:layout_width="wrap_content" android:layout_height="wrap_content" tools:text="early morning jog" android:textcolor="@android:color/white"/> <view android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1"/>
since it's listview
divider. see dividerheight
, can set in xml or java remove divider.
android:dividerheight="0dp" // or listview.setdividerheight(0);
Comments
Post a Comment