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

  • Home
  • SEARCH
  • 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 7172759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:40:57+00:00 2026-05-28T15:40:57+00:00

I have the following layout: <?xml version=1.0 encoding=utf-8?> <RelativeLayout android:id=@+navigate/RLayout android:layout_width=fill_parent android:layout_height=fill_parent android:background=#ABABAB xmlns:android=http://schemas.android.com/apk/res/android

  • 0

I have the following layout:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    android:id="@+navigate/RLayout"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#ABABAB"
    xmlns:android="http://schemas.android.com/apk/res/android"
    >
    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="10dp"
        android:textStyle="bold"
        android:id="@+id/myid" 
        android:layout_centerHorizontal="true"
        android:src="@drawable/myid"
        android:layout_marginTop="15dp" />.
    <RelativeLayout android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:layout_margin="10dp"
        android:orientation="vertical"
        android:id="@+id/firstRectangle"
        android:background="@drawable/bg"
        android:layout_below="@+id/myid" >
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="10dp"
        android:textStyle="bold|italic"
        android:textColor="#000000"
        android:id="@+id/hotelinfos"
        android:layout_marginTop="10dp"
        android:layout_marginLeft="10dp"
        android:layout_below="@+id/myid"
        android:layout_alignLeft="@+id/myid"/>
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="10dp"
        android:textStyle="bold"
        android:textColor="#000000"
        android:id="@+id/hotelname"
        android:layout_below="@+id/hotelinfos"
        android:layout_alignLeft="@+id/hotelinfos" 
        android:layout_marginTop="10dp" />
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="10dp"
        android:textColor="#000000"
        android:id="@+id/hoteladdress"
        android:layout_below="@+id/hotelname"
        android:layout_alignLeft="@+id/hotelname" 
        android:layout_marginTop="10dp" />
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="10dp"
        android:id="@+id/hotelphone"
        android:layout_below="@+id/hoteladdress"
        android:layout_alignLeft="@+id/hoteladdress" 
        android:layout_marginTop="10dp"
        android:textColor="#12C"
        android:textStyle="bold|italic"
        android:onClick="onClick"
        android:clickable="true" />
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="10dp"
        android:textColor="#12C"
        android:onClick="onClick"
        android:clickable="true"
        android:textStyle="bold|italic"
        android:id="@+id/hotelemail"
        android:layout_below="@+id/hotelphone"
        android:layout_alignLeft="@+id/hotelphone"
        android:layout_marginTop="10dp"
        android:paddingBottom="10dp" />
    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/picture" 
        android:layout_below="@+id/myid"
        android:layout_alignParentRight="true"
        android:layout_marginRight="10dp"       
        android:layout_marginTop="10dp"/>
    </RelativeLayout>
    <RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:layout_margin="10dp"
        android:orientation="vertical"
        android:id="@+id/SecondRectangle"
        android:background="@drawable/bg"
        android:layout_below="@+id/firstRectangle" >
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="10dp"
        android:textColor="#000000"
        android:textStyle="bold|italic"
        android:id="@+id/bookinginfos"
        android:layout_below="@+id/firstRectangle"
        android:layout_alignLeft="@+id/firstRectangle"
        android:layout_marginLeft="10dp"
        android:layout_marginTop="10dp" />
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="10dp"
        android:textColor="#000000"
        android:id="@+id/pnr"
        android:layout_below="@+id/bookinginfos"
        android:layout_alignLeft="@+id/bookinginfos" 
        android:layout_marginTop="10dp"
        android:layout_marginRight="10dp" />
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="10dp"
        android:textColor="#000000"
        android:id="@+id/segmentCode"
        android:layout_below="@+id/pnr"
        android:layout_alignLeft="@+id/pnr"
        android:layout_marginRight="10dp" />
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="10dp"
        android:textColor="#000000"
        android:id="@+id/checkin"
        android:layout_below="@+id/segmentCode"
        android:layout_alignLeft="@+id/segmentCode" 
        android:layout_marginTop="10dp"
        android:layout_marginRight="10dp" />
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="10dp"
        android:textColor="#000000"
        android:id="@+id/checkout"
        android:layout_below="@+id/checkin"
        android:layout_alignLeft="@+id/checkin" 
        android:layout_marginRight="10dp" />
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="10dp"
        android:textColor="#000000"
        android:id="@+id/nights"    
        android:layout_below="@+id/checkout"
        android:layout_alignLeft="@+id/checkout"
        android:layout_marginRight="10dp" />
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="10dp"
        android:textColor="#000000"
        android:id="@+id/roomType"
        android:layout_below="@+id/nights"
        android:layout_alignLeft="@+id/nights" 
        android:layout_marginTop="10dp"
        android:layout_marginRight="10dp" />
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="10dp"
        android:textColor="#000000"
        android:id="@+id/boardBasis"
        android:layout_below="@+id/roomType"
        android:layout_alignLeft="@+id/roomType"
        android:layout_marginRight="10dp" />
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="10dp"
        android:textColor="#000000"
        android:id="@+id/paxNames"
        android:layout_below="@+id/boardBasis"
        android:layout_alignLeft="@+id/boardBasis" 
        android:layout_marginTop="10dp"
        android:layout_marginRight="10dp"
        android:paddingBottom="10dp" />
    </RelativeLayout>
    <RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:layout_margin="10dp"
        android:orientation="vertical"
        android:id="@+id/thirdRectangle"
        android:background="@drawable/bg"
        android:layout_below="@+id/SecondRectangle" >
            <ScrollView android:layout_width="fill_parent" android:layout_height="wrap_content">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="10dp"
        android:textColor="#000000"
        android:textStyle="bold|italic"
        android:id="@+id/forHotel"
        android:layout_below="@+id/SecondRectangle"
        android:layout_alignLeft="@+id/SecondRectangle" 
        android:layout_marginLeft="10dp" />
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="10dp"
        android:textColor="#000000"
        android:id="@+id/supplierCode"
        android:layout_below="@+id/forHotel"
        android:layout_alignLeft="@+id/forHotel"
        android:layout_marginTop="10dp"
        android:layout_marginRight="10dp"
        android:paddingBottom="10dp"/>
        </ScrollView>

    </RelativeLayout>
</RelativeLayout>

I would like to scroll in this layout because the last part of the relativelayout is not visible!
But i don’t know how to do it.
I tried to add a scrollview but i got the error: scrollview can host only one direct child!
Do you have any tips for me?

Thanks in advance for your help!

  • 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-28T15:40:58+00:00Added an answer on May 28, 2026 at 3:40 pm

    ScrollView expects a single child view and in your layout you have 2 TextView.
    To make the ScrollView work you have to wrap your TextView in a ViewGroup like LinearLayout or RelativeLayout.

    Edited code:

    <?xml version="1.0" encoding="utf-8"?>
    <ScrollView android:layout_width="match_parent" android:layout_height="match_parent">
    <RelativeLayout
        android:id="@+navigate/RLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#ABABAB"
        xmlns:android="http://schemas.android.com/apk/res/android"
        >
    // ... THE REST OF YOUR CODE
    </RelativeLayout>
    </ScrollView>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following layout defined in XML: <?xml version=1.0 encoding=utf-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_height=wrap_content
I have the following layout: <?xml version=1.0 encoding=utf-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=fill_parent> <GridView android:id=@+id/grid
I have the following the layout file <?xml version=1.0 encoding=utf-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android xmlns:app=http://schemas.android.com/apk/res/com.company android:layout_width=fill_parent
I have the following layout in my xml file: <RelativeLayout android:layout_width=fill_parent android:layout_height=fill_parent> <FrameLayout android:id=@+id/logoLayout
I have the following layout buttons.xml <?xml version=1.0 encoding=UTF-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android android:id=@+id/buttonsLayout android:layout_width=fill_parent android:layout_height=wrap_content
I have the following XML layout for a ListActivity. <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android
I have the following TextView in my XML layout file:- <TextView android:layout_width=fill_parent android:layout_height=wrap_content android:text=@string/autolink_test
I have used the following in android manifest. <?xml version=1.0 encoding=utf-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android xmlns:ads=http://schemas.android.com/apk/lib/com.google.ads
I have the following layout in XML (splashscreen.xml): <?xml version=1.0 encoding=utf-8?> <FrameLayout xmlns:android=http://schemas.android.com/apk/res/android android:id=@+id/frmLayout
I have the following layout <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=match_parent android:layout_height=match_parent android:orientation=horizontal android:background=#f00

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.