开发者

Listview not displaying properly

I am having a problem with my listview, if there is something with a long name it creates a huge gap between list items. the view should display a name and date

Listview not displaying properly

as you can see there is a huge space after monthly event and the date is missing, why is it doing that?

listview xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content">
<TextView android:text="@+id/calendarEntryText"
          android:id="@+id/calendarEntryText"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:padding="10dp"
          android:textSize="25sp"/>
<TextView android:text="@+id/dateEntryText"
          andro开发者_运维问答id:id="@+id/dateEntryText"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:padding="15dp"
          android:textSize="20sp"/>
</LinearLayout>


I can tell you about the missing part, it's because you are using horizontal linear layout and it's first child is occupying the whole width of the parent. so there is not place for the second child. I suggest you to use relative layout. HTH.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜