i have an android application which has a listview for listing 14 items inside it. i have coded as
<LinearLayout android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ListView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:clickable="true"
android:id="@+id/my_list"/>
</LinearLayout>
and my activity file is working as
ListView list;
list = (ListView)findViewById(R.id.my_list);
ArrayAdapter<CharSequence> list_adapter= ArrayAdapter.createFromResource(
this, R.array.my_array, android.R.layout.simple_list_item_1);
my_list.setAdapter(list_adapter);
The code works properly. but i want to reduce the size of listview, so that i can list maximum items in the screen.
how can i do this? i had searched it. but didnt find any useful guidance.
Got it dear…
Its simple…
I had just made my own layout in R/layout as mylist.xml
and then i changed my main.xml to show a listview. like,
And atlast i have my actvty file like