Good Day!!!
I have a problem with the layout specially in the landscape orientation in android.
When I am going to change the orientation to landscape, it seems that the ImageView is in a fixed position and I can only see scrollbar in the listview…I just want to have a layout that also the imageview can be scrolled so that I can see clearly the list items.
Here’s my layout xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="fill_parent"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:layout_height="wrap_content"
android:contentDescription="@string/app_name"
android:src="@drawable/banner" />
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/imageView1"
android:drawSelectorOnTop="true" />
</RelativeLayout>
This is a bit tricky because you can’t put a listview inside a scrollview but you can make it work if you create a custom adapter which can have different types of rows (e.g. A row with text only, a row with an ImageView, etc.).
Then have your first row in that ListView always be an image.
Check out this tutorial (Section: Different list items’ layouts) to learn how to make different types of rows.