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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:38:30+00:00 2026-05-31T09:38:30+00:00

I want to add scroll bar to my linear layout form as it is

  • 0

I want to add scroll bar to my linear layout form as it is too long .

It has 19 text view and edit views .

Please can any one add the scroll view code to the xml file .

this is my xml code :

<?xml version="1.0" encoding="utf-8"?>

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ScrollView01"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >



<TextView
    android:id="@+id/Name"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Name"
    android:textAppearance="?android:attr/textAppearanceLarge" />

<EditText
    android:id="@+id/editName"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" />

 <TextView
    android:id="@+id/FirstName"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="FirstName"
    android:textAppearance="?android:attr/textAppearanceLarge" />

<EditText
    android:id="@+id/editFirstName"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    <requestFocus />
</EditText>

 <TextView
    android:id="@+id/DateOfBirth"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Date Of Birth"
    android:textAppearance="?android:attr/textAppearanceLarge" />

 <ScrollView
     android:id="@+id/scrollView1"
     android:layout_width="match_parent"
     android:layout_height="wrap_content" >

     <LinearLayout
         android:id="@+id/linearLayout2"
         android:layout_width="match_parent"
         android:layout_height="match_parent" >
     </LinearLayout>
 </ScrollView>

 <EditText
     android:id="@+id/editDateOfBirth"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:inputType="date" />

 <TextView
    android:id="@+id/PlaceOfbirth"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Place Of birth"
    android:textAppearance="?android:attr/textAppearanceLarge" />

<EditText
    android:id="@+id/editPlaceOfbirth"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    <requestFocus />
</EditText>
 <TextView
    android:id="@+id/Address"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Address"
    android:textAppearance="?android:attr/textAppearanceLarge" />

 <EditText
     android:id="@+id/editAddress"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:inputType="textPostalAddress" />

 <TextView
    android:id="@+id/PhoneNumber"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="PhoneNumber"
    android:textAppearance="?android:attr/textAppearanceLarge" />

 <EditText
     android:id="@+id/editPhoneNumber"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:inputType="phone" />

 <TextView
    android:id="@+id/e_mail"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="e-mail"
    android:textAppearance="?android:attr/textAppearanceLarge" />

<EditText
    android:id="@+id/edite_mail"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:inputType="textEmailAddress" >

    <requestFocus />
</EditText>
 <TextView
    android:id="@+id/SocialInsurance"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Social Insurance"
    android:textAppearance="?android:attr/textAppearanceLarge" />

<EditText
    android:id="@+id/editSocialInsurance"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:inputType="number" >

    <requestFocus />
</EditText>
 <TextView
    android:id="@+id/GeneralPractioner"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="General Practioner"
    android:textAppearance="?android:attr/textAppearanceLarge" />

<EditText
    android:id="@+id/editGeneralPractioner"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    <requestFocus />
</EditText>

<TextView
    android:id="@+id/Size"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Size"
    android:textAppearance="?android:attr/textAppearanceLarge" />

<EditText
    android:id="@+id/editSize"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    <requestFocus />
</EditText>

 <TextView
    android:id="@+id/Weight"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Weight"
    android:textAppearance="?android:attr/textAppearanceLarge" />

<EditText
    android:id="@+id/editWeight"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    <requestFocus />
</EditText>
 <TextView
    android:id="@+id/BMI"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="BMI"
    android:textAppearance="?android:attr/textAppearanceLarge" />

<EditText
    android:id="@+id/editBMI"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    <requestFocus />
</EditText>
 <TextView
    android:id="@+id/BloodGroup"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Blood Group"
    android:textAppearance="?android:attr/textAppearanceLarge" />

<EditText
    android:id="@+id/editBloodGroup"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    <requestFocus />
</EditText>
<TextView
    android:id="@+id/DoctorNote"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Doctor Note"
    android:textAppearance="?android:attr/textAppearanceLarge" />

<EditText
    android:id="@+id/editDoctorNote"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:inputType="textMultiLine" >

    <requestFocus />
</EditText>
<TextView
    android:id="@+id/NurseNote"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Nurse Note"
    android:textAppearance="?android:attr/textAppearanceLarge" />

<EditText
    android:id="@+id/editNurseNote"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" 
    android:inputType="textMultiLine" >

    <requestFocus />
</EditText>
<TextView
    android:id="@+id/Results"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Results"
    android:textAppearance="?android:attr/textAppearanceLarge" />

<EditText
    android:id="@+id/editResults"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" 
    android:inputType="textMultiLine" >

    <requestFocus />
</EditText>
 <TextView
    android:id="@+id/DrugPrescription"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="DrugPrescription"
    android:textAppearance="?android:attr/textAppearanceLarge" />

<EditText
    android:id="@+id/editDrugPrescription"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    <requestFocus />
</EditText>
<TextView
    android:id="@+id/Pathology"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Pathology"
    android:textAppearance="?android:attr/textAppearanceLarge" />

<EditText
    android:id="@+id/editPathology"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    <requestFocus />
</EditText>
<TextView
    android:id="@+id/Recommendation"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Recommendation"
    android:textAppearance="?android:attr/textAppearanceLarge" />

<EditText
    android:id="@+id/editRecommendation"
    android:layout_width="wrap_content"
    android:layout_height="match_parent" 
    android:inputType="textMultiLine" >
    <requestFocus />
</EditText>

<Button
    android:id="@+id/ButtonAddDatabase"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="Register" />

  </LinearLayout>
 </ScrollView>

this is working fine . But when I add scroll it gives me an error (FATAL ERROR)

    03-16 00:06:18.140: E/AndroidRuntime(1215): FATAL EXCEPTION: main
    03-16 00:06:18.140: E/AndroidRuntime(1215): java.lang.RuntimeException: Unable to   start activity ComponentInfo{android.sqlite/android.sqlite.CreatePatientActivity}: java.lang.RuntimeException: Binary XML file line #3: You must supply a layout_width attribute.
  • 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-31T09:38:32+00:00Added an answer on May 31, 2026 at 9:38 am

    All you need to do is put the LinearLayout in a ScrollView container:

    <?xml version="1.0" encoding="utf-8"?>
    <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
          android:layout_width="fill_parent" 
          android:layout_height="fill_parent">
    
        <LinearLayout android:id="@+id/LinearLayout1"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">
    
            ...
    
        </LinearLayout>
    </ScrollView>
    

    Note that wrap_content is used here, because the LinearLayout’s contents define the height.

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

Sidebar

Related Questions

I am working with SSRS 2008 and want to add pagination or scroll bar
I want add my custom sidebar next right column all page. Please check this
I want to add a tab to a certain tab bar from inside the
I want to use a scroll bar or track bar control in my application
Possible Duplicate: Is there anyway to add same scroll menubar at the navigation bar?
I have a website built with ASP.NET (3.5) and want add some level of
I have a list of string values that I want add to a hashtable
I have numbers in javascript from 01(int) to 09(int) and I want add 1(int)
I used RollingFileAppender. And I want add a blank line to the log when
I want to add some jQuery functionality to our sites where one piece of

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.