I have a listview that will be filled with AsyncTask
and at the bottom edge of the app I need to show a fixed overlay layout like this:
But I can't figure it out how I can do this in xml? This is my present layout.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ListView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<!-- Probably I need to do something here -->
</LinearLayout>
As Daniel has suggested, use a
RelativeLayout
because it allows stacking of components(same withFrameLayout
andSurfaceView
). The following code will give you the layout you are looking for:In the code above, the color hex values used for
transparentBlack
is#95000000
andwhite
is#ffffff
.Here is an excellent tutorial on the basics of UI design in android: Android User Interface Design: Layout Basics.
Change the parent layout to
RelativeLayout
orFrameLayout
and position the fixed view at the same level of theListView
(but after theListView
)Something like:
You can then align the fixed view to the bottom of the wrapping
RelativeLayout