В моем списке есть только два элемента, и он охватывает половину экрана, но listview все еще показывает прокрутку вокруг него. Я поставил высота wrap_contentУдалить прокрутку в Listview
код макета ниже:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ListView
android:id="@+id/listLikeWhatsapp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:divider="@android:color/transparent"
android:dividerHeight="10.0sp"
/>
</LinearLayout>
Я не хочу прокрутки появляться на ListView, потому что он будет иметь только две вещи, и нет никакой необходимости показать. Я не уверен, что вызывает появление прокрутки.
Любая помощь будет высоко оценена.
Благодарим Вас заранее
UPDATE
Вот мой пункт строка XML:
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:background="@drawable/roundedshape"
android:alpha="0.7">
<ImageView
android:id="@+id/icon"
android:layout_width="50dp"
android:layout_height="50dp"
android:contentDescription="desc"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:src="@drawable/ic_insert_emoticon_black_48dp"
/>
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_toRightOf="@+id/icon"
android:paddingBottom="5dp"
android:text="Assignments"
android:textStyle="bold"
android:textSize="18sp"
android:textColor="#000"/>
<TextView
android:id="@+id/last_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/title"
android:layout_below="@+id/title"
android:text="Last Update : 01-01-2017"
android:textSize="13sp"
android:textColor="#696969"/>
<TextView
android:id="@+id/unread_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/title"
android:layout_alignBottom="@+id/title"
android:layout_alignParentRight="true"
android:text="04"
android:textSize="12sp"
android:background="@drawable/shape_circular"
android:padding="5dp"
android:textColor="#FFF"
android:textStyle="bold"
android:layout_marginRight="5dp"
/>
</RelativeLayout>
Попробуйте добавить андроид: layout_height = "match_parent" вместо wrap_content –
Ну я хочу добавить TextView ниже этого ListView. При применении match_parent не будет отображаться текст ниже. Правильно? – Anjum
1. старайтесь не использовать 'fill_parent'. 2. Можете ли вы загрузить xml элементов строки? –