Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8781153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:13:38+00:00 2026-06-13T20:13:38+00:00

I have created a layout for an activity. The layout contains some image buttons

  • 0

I have created a layout for an activity. The layout contains some image buttons and text views. The problem is that when I am setting the orientation of my device to portrait, its working fine, but when I am changing the orientation to landscape, the layout is giving unexpected results.

Here is my layout file:

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:fillViewport="true"
    android:padding="50dp" >


<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    <ImageView
        android:id="@+id/settings_imageView"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:src="@android:drawable/bottom_bar" />

    <TextView
        android:id="@+id/settings_textView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:layout_marginBottom="16dp"
        android:text="@string/my_settings"
        android:textAppearance="?android:attr/textAppearanceMedium" />

    <ImageView
        android:id="@+id/myProgramming_imageView"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_above="@+id/settings_imageView"
        android:layout_alignParentLeft="true"
        android:src="@android:drawable/bottom_bar" />

    <TextView
        android:id="@+id/myProgramming_textView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@+id/myProgramming_imageView"
        android:layout_centerHorizontal="true"
        android:layout_marginBottom="14dp"
        android:text="@string/my_programming"
        android:textAppearance="?android:attr/textAppearanceMedium" />

    <ImageView
        android:id="@+id/library_imageView"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_above="@+id/myProgramming_imageView"
        android:layout_alignParentLeft="true"
        android:src="@android:drawable/bottom_bar" />

    <TextView
        android:id="@+id/library_textView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@+id/library_imageView"
        android:layout_centerHorizontal="true"
        android:layout_marginBottom="16dp"
        android:text="@string/library"
        android:textAppearance="?android:attr/textAppearanceMedium" />

</RelativeLayout>
</ScrollView>

Here is the output of the portrait mode on device, and this is the output which is expected on both portrait and landscape modes:

Portrait mode

Here is the output for the landscape mode on device, this is unexpected:

Landscape mode

I want the layout to look alike in portrait and landscape modes.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T20:13:39+00:00Added an answer on June 13, 2026 at 8:13 pm

    – It seems you screen size is creating a problem here.

    – You will have to create another folder under res directory as layout-land, and in it create a .xml file just like you did in layout folder, and make it look the way you want it in landscape mode.

    – When your app goes into landscape mode, automatically this .xml file will be selected (ie from the layout-land) folder.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an activity that contains a linear layout and a fragment placeholder. <RelativeLayout
I created layout and layout-land folders, in Manifest i have android:configChanges=keyboardHidden|orientation If i remove
I have an activity with a layout contains an ImageView and TextView . ImageView
I have created a radio group which contains two buttons, I can select one
Dear friends, I have created one music app. It contains some collection of albums,
I have an app that contains two buttons, both that are suppose to take
I have a TextView which contains an image on the left side and text
I have created an Android status bar notification with a custom layout which contains
I have imageView inside a relative layout. And when i create the activity i
i am designing an app for android tablets. I have created a layout file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.