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 4553630
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T16:58:26+00:00 2026-05-21T16:58:26+00:00

I am trying to make the screen which fits great on a vertical orientation

  • 0

I am trying to make the screen which fits great on a vertical orientation scroll for a horizontal as it does not fit and does not scroll. I added a scroll view with the single child of linear layout and the views I want inside that. No errors but it still does not scroll when I turn the phone to a horizontal orientation. What am I doing wrong? below is my XML

Thanks

<TextView 
android:text="test App" 
android:textSize="20dp"
android:layout_gravity="center_horizontal"
android:textColor="#FCFCFC" 
android:id="@+id/textView1" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content"
></TextView>

<TextView 
android:text="" 
android:textSize="20dp"
android:layout_gravity="center_horizontal"
android:textColor="#FCFCFC" 
android:id="@+id/textView3" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content"
></TextView>


<ScrollView
android:layout_width="match_parent"
android:layout_height="400dp"
>

<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">



<TextView 
android:text="Last Name" 
android:textSize="15dp"
android:id="@+id/textView4" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content"
android:textColor="#FCFCFC"
android:singleLine="true"
></TextView>



<EditText 
android:layout_width="fill_parent" 
android:id="@+id/editText1" 
android:layout_height="wrap_content" 
android:text=""
android:singleLine="true"
></EditText>


<TextView 
android:text="" 
android:textSize="10dp"
android:layout_gravity="center_horizontal"
android:id="@+id/textView5" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content"
></TextView>


<TextView 
android:text="First Name"
android:textSize="15dp"
android:id="@+id/textView6" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content"
android:textColor="#FCFCFC"
android:singleLine="true"
></TextView>

<EditText 
android:layout_width="fill_parent" 
android:id="@+id/editText2" 
android:layout_height="wrap_content" 
android:text=""
android:textSize="20dp"
android:singleLine="true"
></EditText>


<TextView 
android:layout_gravity="center_horizontal" 
android:text=""
android:textSize="15dp"
android:layout_width="wrap_content" 
android:id="@+id/TextView01" 
android:layout_height="wrap_content"
></TextView>

<TextView 
android:text="Description" 
android:textSize="15dp"
android:id="@+id/textView4" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content"
android:textColor="#FCFCFC"
android:singleLine="true"
></TextView>


 <EditText 
android:layout_width="fill_parent" 
android:id="@+id/editText1" 
android:layout_height="wrap_content" 
android:text=""
android:textSize="15dp"
android:singleLine="false"
android:lines="10"
></EditText>



</LinearLayout>
</ScrollView>




<TextView 
android:layout_gravity="center_horizontal" 
android:text="" 
android:id="@+id/TextView02" 
android:textColor="#FCFCFC" 
android:textSize="5dp" 
android:layout_height="wrap_content" 
android:layout_width="wrap_content"
></TextView>


<Button 
android:text="Next"
android:textSize="20dp"
android:layout_gravity="center_horizontal"
android:id="@+id/nextpage" 
android:layout_width="150dp" 
android:layout_height="60dp"
android:layout_alignParentBottom="true"
></Button>

  • 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-05-21T16:58:27+00:00Added an answer on May 21, 2026 at 4:58 pm

    Your ScrollView and it’s contents are always the same size. The view layout doesn’t pay attention to whether or not it’s visible on screen. Currently, the last TextView and Button in your layout are probably also hidden in lanscape mode (I’m assuming all this is wrapped in a root LinearLayout since the root tag is missing). The ScrollView simply says, “if my contents are larger then I am, I will scroll them”.

    You should consider a layout where your top elements hang to the top, your bottom two elements hang to the bottom, and the scrollview fills the space in between. That way, when it comes to landscape the view will be smaller, and the contents will start scrolling within.

    Here’s what I THINK you want 🙂

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent">
      <!-- Top Elements -->
      <TextView 
        android:text="test App" 
        android:textSize="20dp"
        android:layout_gravity="center_horizontal"
        android:textColor="#FCFCFC" 
        android:id="@+id/textView1" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" />
      <TextView 
        android:text="" 
        android:textSize="20dp"
        android:layout_gravity="center_horizontal"
        android:textColor="#FCFCFC" 
        android:id="@+id/textView3" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content"
        android:layout_below="@id/textView1" />
    
      <!-- Bottom Elements -->
      <Button 
        android:text="Next"
        android:textSize="20dp"
        android:layout_gravity="center_horizontal"
        android:id="@+id/nextpage" 
        android:layout_width="150dp" 
        android:layout_height="60dp"
        android:layout_alignParentBottom="true" />
      <TextView 
        android:layout_gravity="center_horizontal" 
        android:text="" 
        android:id="@+id/TextView02" 
        android:textColor="#FCFCFC" 
        android:textSize="5dp" 
        android:layout_height="wrap_content" 
        android:layout_width="wrap_content"
        android:layout_above="@id/nextpage" />
    
      <ScrollView
        android:layout_width="match_parent"
        android:layout_height="fill_parent"
        android:layout_below="@id/textView3"
        android:layout_above="@id/TextView02">
        <LinearLayout
          android:orientation="vertical"
          android:layout_width="match_parent"
          android:layout_height="wrap_content">
          <TextView 
            android:text="Last Name" 
            android:textSize="15dp"
            android:id="@+id/textView4" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content"
            android:textColor="#FCFCFC"
            android:singleLine="true" />
          <EditText 
            android:layout_width="fill_parent" 
            android:id="@+id/editText1" 
            android:layout_height="wrap_content" 
            android:text=""
            android:singleLine="true" />
          <TextView 
            android:text="" 
            android:textSize="10dp"
            android:layout_gravity="center_horizontal"
            android:id="@+id/textView5" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" />
          <TextView 
            android:text="First Name"
            android:textSize="15dp"
            android:id="@+id/textView6" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content"
            android:textColor="#FCFCFC"
            android:singleLine="true" />
          <EditText 
            android:layout_width="fill_parent" 
            android:id="@+id/editText2" 
            android:layout_height="wrap_content" 
            android:text=""
            android:textSize="20dp"
            android:singleLine="true" />
          <TextView 
            android:layout_gravity="center_horizontal" 
            android:text=""
            android:textSize="15dp"
            android:layout_width="wrap_content" 
            android:id="@+id/TextView01" 
            android:layout_height="wrap_content" />
          <TextView 
            android:text="Description" 
            android:textSize="15dp"
            android:id="@+id/textView4" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content"
            android:textColor="#FCFCFC"
            android:singleLine="true" />
         <EditText 
            android:layout_width="fill_parent" 
            android:id="@+id/editText1" 
            android:layout_height="wrap_content" 
            android:text=""
            android:textSize="15dp"
            android:singleLine="false"
            android:lines="10" />
        </LinearLayout>
      </ScrollView>
    
    </RelativeLayout>
    

    I don’t believe your 400dp height is necessary in this case, because the bottom elements will hang to the bottom of the screen instead of you needing a fixed height to space them out. However, if it is still relevant put it on the LinearLayout inside the ScrollView, not the ScrollView itself. This is the whole layout, BTW. Not to be inserted inside anything.

    If that’s not exactly what you are looking for, hopefully it puts you on the right path 🙂

    Hope that Helps!

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

Sidebar

Related Questions

I am trying make long screen to vertical direction. So, I need a screen
I am trying to make an application in which one component captures the screen
So i'm just trying to make a ball bounce around the screen which should
im trying to make my images fit nicely into screen without overlapping but no
I'm trying to make a triangle (isosceles triangle) to move around the screen and
I am trying to make an application for drawing shapes on screen by touching
I am trying to make an imageview that rotates while sliding across the screen.
I'm trying to make sure my web application is always centered on the screen
I'm trying to make a gradient that emits from the middle of the screen
Im trying to make custom icons for my HTC EVO, which is running Cyanogen

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.