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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:54:23+00:00 2026-06-09T17:54:23+00:00

When trying to render the following RelativeLayout on smaller screen sizes. In the graphical

  • 0

When trying to render the following RelativeLayout on smaller screen sizes. In the graphical layout editor, the second TextView is completely hidden, but the first one is fully expanded showing the complete text contents. I understand that TextViews are supposed to be scrollable.

Is there any way to use RelativeLayout and give each an equal portion of the screen, or should I just use a LinearLayout and use layout_weight? From the guidance in the Android documentation, I was under the impression I should avoid using LinearLayout in favor of RelativeLayout.

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

    <TextView
        android:id="@+id/tv1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:fillViewport="true"
        android:gravity="center"
        android:text="Lorem ipsum dolor sit amet, onsectetur adipiscing elit. Curabitur molestie tempor ante non interdum. Nullam sit amet diam ligula. Suspendisse ultricies commodo felis in rutrum. Lorem ipsum dolor sit amet, onsectetur adipiscing elit. Curabitur molestie tempor ante non interdum. Nullam sit amet diam ligula. Suspendisse ultricies commodo felis in rutrum.Lorem ipsum dolor sit amet, onsectetur adipiscing elit. Curabitur molestie tempor ante non interdum. Nullam sit amet diam ligula. Suspendisse ultricies commodo felis in rutrum."
        android:scrollbars="vertical"
        android:maxlines="100"
        android:textSize="22dp" >
    </TextView>

    <TextView
        android:id="@+id/tv2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/tv1"
        android:fillViewport="true"
        android:gravity="center"
        android:scrollbars="vertical"
        android:maxlines="100"
        android:text="Lorem ipsum dolor sit amet, onsectetur adipiscing elit. Curabitur molestie tempor ante non interdum. Nullam sit amet diam ligula. Suspendisse ultricies commodo felis in rutrum. Lorem ipsum dolor sit amet, onsectetur adipiscing elit. Curabitur molestie tempor ante non interdum. Nullam sit amet diam ligula. Suspendisse ultricies commodo felis in rutrum.Lorem ipsum dolor sit amet, onsectetur adipiscing elit. Curabitur molestie tempor ante non interdum. Nullam sit amet diam ligula. Suspendisse ultricies commodo felis in rutrum."
        android:textSize="22dp" />
</RelativeLayout>

  • 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-09T17:54:25+00:00Added an answer on June 9, 2026 at 5:54 pm

    Since you used “wrap_content” in the first TextView, it fills all the space available then there is no space left for the second TextView. if you wish to have them both, then you can put them inside a LinearLayout with equal weights or you can specify a certain size in the “layout_height” field.
    P.S. If you want them to be equal on all devices then LinearLayout is your best bet. Also you can have the LinearLayout inside the RelativeLayout in case you want to add any other widgets relative to them.

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

Sidebar

Related Questions

Background I'm receiving the following error when trying to render a partial view in
i´m trying to render PDF with renderpdf grails plugin, but their documentation is very
I am trying to render the following HTML using an MVC3 Razor View: <input
I get the following error when trying to render foreign chars from a dict.
I am trying to render a view + layout based on a condition. The
I'm trying the render an HTML list that looks like the following, using the
I using symfony 1.4.8 and when trying to render the hidden csrf form field
I'm trying to render the following HTML code using xslt: <foo:bar href=[MYURL]/> I created
I am trying to render a chart from the following query: Questionnaires created by
Following this SO post , I am trying to render indented comments using the

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.