strike
strike

Reputation: 1039

CustomizedView in android - listView and Button UI

i'm trying to develop the given UI in android, there is a ListView and on top of it a button is visible , listView's height is Fill_PARENT and button is fix at it's position.

How to add a view above of a view? or any idea about creating this layout using XML or customizedView.

enter image description here

Upvotes: 0

Views: 433

Answers (2)

Wesley
Wesley

Reputation: 1808

I think from what i understand in your question it seems like you are looking for FrameLayout. So there is a list view and top of it is a button. Right? Try this.

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout android:id="@+id/mainlayout" android:layout_height="fill_parent" android:layout_width="fill_parent" android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android">

<ListView android:layout_height="fill_parent" android:layout_width="fill_parent" android:padding="10dp" android:id="@+id/myListView"/>

<ImageButton
        android:id="@+id/imageButton1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/buttondrawable" />
</FrameLayout>

Upvotes: 0

Houcine
Houcine

Reputation: 24181

you need to create your layout for your item , and ovverride the BaseAdapter to create your own adapter for your custom ListView ,

see this tutorial to learn how to create a custom ListView

see this question it is similar to your case : how to customize listview row android

and finally , this tutorial is very good and it manage the selection states for your list items :

Upvotes: 1

Related Questions