Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

My listview doesn't show last item

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="info.androidhive.materialtabs.fragments.OneFragment">

    <ListView
        android:id="@+id/olaylar_liste"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"></ListView>
</LinearLayout>

enter image description here

Last item is not showing. Please help.

like image 411
Mehmet Özay Avatar asked Dec 24 '15 08:12

Mehmet Özay


People also ask

How do I remove items from list view?

Use the RemoveAt or Clear method of the Items property. The RemoveAt method removes a single item; the Clear method removes all items from the list.

How do I resize a list view?

If you only want to set width and height of listview. you can set it by right clicking on listview in xml and select set width / set height and set it, for ex. 20dp, 50 dp etc..

What is the use of ListView?

A list view is an adapter view that does not know the details, such as type and contents, of the views it contains. Instead list view requests views on demand from a ListAdapter as needed, such as to display new views as the user scrolls up or down. In order to display items in the list, call setAdapter(android.


1 Answers

Add this line to your Viewpager

android:layout_marginBottom="?attr/actionBarSize"

because the size you don't have at bottom is exactly the size taken by your ToolBar,

which is supposed to be hide (using new Android Design) when you reach to bottom.

    <android.support.v4.view.ViewPager
        android:id="@+id/container"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginBottom="?attr/actionBarSize"
        app:layout_behavior="@string/appbar_scrolling_view_behavior" />
like image 116
Cedriga Avatar answered Oct 06 '22 19:10

Cedriga