android - Listview item smaller than screen width so the activity background is visible on the sides -
i need know how modify list items layout don't fill screen width , activity background visible on sides.
i tried various layout_width no success.
i want know how it, i'll apply rule in case
edit: xml code of list item
<?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" android:layout_gravity="center_horizontal" android:orientation="vertical" android:layout_marginleft="20dp" android:cliptopadding="true" android:background="#ffffff" > <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" > <imageview android:id="@+id/post_logo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_post" /> <linearlayout android:layout_width="wrap_content" android:layout_height="match_parent" android:orientation="vertical" > <textview android:id="@+id/post_nick" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancelarge" /> <textview android:id="@+id/post_date" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancesmall" /> </linearlayout> </linearlayout> <textview android:id="@+id/post_content" android:layout_width="match_parent" android:layout_height="wrap_content" android:textsize="15sp" android:paddingtop="5dp" android:paddingbottom="5dp" android:paddingleft="5dp" android:paddingright="5dp" android:textappearance="?android:attr/textappearancemedium" /> </linearlayout>
you can set android:layout_marginleft
, android:layout_marginright
on listview (in xml) set minimum margin between listview , screen sides.
Comments
Post a Comment