Reputation: 21929
I want a list view and below of that list view i want one image.when i use the below code the list view and image view are appeared only in Portrait mode but not landscape mode, Can any one give me the suggestions for displaying that list view and image view in Landscape also.
My xml code is
<?xml version="1.0" encoding="UTF-8"?>
<FrameLayout
android:id="@+id/FrameLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<com.google.android.maps.MapView
android:id="@+id/mapView"
android:layout_width="fill_parent"
android:enabled="true"
android:clickable="true"
android:apiKey="@string/apikey"
android:layout_height="wrap_content"
/>
<RelativeLayout android:orientation="vertical"
android:layout_width="fill_parent"
android:id="@+id/linerlayouttransparent"
android:layout_height="fill_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:gravity="top"
android:paddingBottom="100sp"
>
<com.fitzengineering.teslaworldnet.presentationlayer.TransparentPanel
android:id="@+id/transparent_panel"
android:layout_width="fill_parent"
android:paddingTop="5sp"
android:paddingLeft="5sp"
android:paddingRight="5sp" android:layout_height="wrap_content" android:paddingBottom="5sp">
<LinearLayout android:id="@+id/LinearLayout01" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" xmlns:android="http://schemas.android.com/apk/res/android">
<ListView android:id="@+id/ListView01" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android">
</ListView>
<TextView android:id="@+id/TextView01"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:height="5sp">
</TextView>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true" android:focusable="true"
android:src="@drawable/back_normal_icon"
android:layout_gravity="center_horizontal"
android:id="@+id/backImageView"></ImageView>
</LinearLayout>
</com.fitzengineering.teslaworldnet.presentationlayer.TransparentPanel>
</LinearLayout>
</RelativeLayout>
</FrameLayout>
Upvotes: 0
Views: 872
Reputation: 8312
under your res folder, you probably have a folder like "drawable" for your image assets. You can add folders called "drawable-port" and "drawable-land" for resource images that are different in portrait and landscape mode...just give them the same filename in their respective folders and reference that filename in the layout code. This same technique can be used on your layout folders to create entirely different layouts in portrait and landscape if simply having two versions of an image isn't sufficient.
Upvotes: 1
Reputation: 1208
Pplease show me the screen shot for the problem you are facing. because from your XMl layout i can see that in the linear layout you have added the listwith height as fill_parent and then you have added text view and then ImageView. So might be this can cause a problem but until and unless i see the screen with the data, which you are displaying, i cant give you the exact point where to make change.
Upvotes: 0