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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T12:09:03+00:00 2026-05-16T12:09:03+00:00

In my Android app, I have a tabbed Activity . In one of the

  • 0

In my Android app, I have a tabbed Activity. In one of the tabs I have two TextViews and two EditTexts.

The first EditText is only one line, and that’s fine. However, I want the other EditText, android:id="@+id/paste_code", to take up the remaining space, but no matter what I do to it, it will only show one line. I don’t want to manually set the number of lines, since the number that would fit on the screen differs based on your device.

Here’s the relevant code. It’s nested inside all the necessary components for a tabbed Activity.

<ScrollView
    android:id="@+id/basicTab"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >
    <LinearLayout
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" 
        android:layout_weight="1" >
        <TextView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="Paste title"
            android:layout_weight="0" />
        <EditText
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:hint="@string/paste_title_hint"
            android:id="@+id/paste_title"
            android:lines="1"
            android:gravity="top|left"
            android:layout_weight="0" />
        <TextView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="Paste text"
            android:layout_weight="0" />
        <EditText
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:hint="@string/paste_hint"
            android:id="@+id/paste_code"
            android:gravity="top|left"
            android:layout_weight="1" />
    </LinearLayout>
</ScrollView>
  • 1 1 Answer
  • 3 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-16T12:09:03+00:00Added an answer on May 16, 2026 at 12:09 pm

    Since the accepted answer doesn’t address the situation fully, here’s a proper fix for people coming to this while searching:

    Firstly, Romain Guy from the Android dev team addresses this well in this blog post:

    http://www.curious-creature.org/2010/08/15/scrollviews-handy-trick/

    Essentially, your ScrollView needs to contain the android:fillViewport="true" attribute.

    If things aren’t working once you’ve done that, here are a couple of things to check:

    • The layout inside the ScrollView (such as a LinearLayout) needs to have layout_height="wrap_content"
    • The view(s) you want to expand should have layout_height="wrap_content"
    • The view(s) you want to expand should have layout_weight="1.0" or similar

    Don’t forget to set minLines="3" or similar in the view(s) you want to expand if you don’t want it/them to shrink too much.

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

Sidebar

Related Questions

In my Android app I have a TabActivity, with 3 tabs. In one of
For an Android app...I have a button on an Activity that calls a custom
In my android app I have fragments, and one of them is very heavy
I started developing an android app that have to interact with MMS attachements, in
I am currently writing my first Android app and have based most of my
I have an Android app, that is using the SIM Toolkit. The application has
In my Android App I have a main activity and some other activities. The
In my android app I have a Tabhost with a ListView as one of
in my android app i have an ui-update-thread that keeps all my views up-to-date.
I'm creating android app that has table layout for the main activity, and that

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.