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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:31:04+00:00 2026-06-14T07:31:04+00:00

<?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android xmlns:tools=http://schemas.android.com/tools android:id=@+id/linearLayout android:orientation=vertical android:layout_width=match_parent android:layout_height=match_parent android:gravity=center_horizontal android:background=@color/background_color> <TextView android:id=@+id/titleTextView

  • 0
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 
   xmlns:android="http://schemas.android.com/apk/res/android"
   xmlns:tools="http://schemas.android.com/tools"
   android:id="@+id/linearLayout" 
   android:orientation="vertical" 
   android:layout_width="match_parent" 
   android:layout_height="match_parent" 
   android:gravity="center_horizontal" 
   android:background="@color/background_color">

   <TextView android:id="@+id/titleTextView"
      android:layout_width="match_parent" 
      android:layout_height="wrap_content"
      android:text="@string/quiz_title" 
      android:layout_marginBottom="2dp"
      android:textSize="@dimen/title_size" 
      android:textColor="@color/text_color" 
      android:gravity="center">
   </TextView>

   <TextView android:id="@+id/questionNumberTextView"
      android:layout_width="match_parent" 
      android:layout_height="wrap_content"
      android:layout_marginBottom="2dp" 
      android:layout_marginTop="2dp"
      android:textColor="@color/text_color" 
      android:textSize="@dimen/text_size" 
      android:layout_gravity="center" 
      android:gravity="center"></TextView>


   <ScrollView android:id="@+id/SlotScrollView" 
     android:layout_width="match_parent"           
     android:padding="0dp">          
      <ImageView android:id="@+id/flagImageView"
         android:adjustViewBounds="false" 
         android:layout_width="match_parent"
         android:layout_height="@dimen/flag_height">
      </ImageView>
   <ScrollView

   <TextView android:id="@+id/guessCountryTextView"
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content"
      android:layout_marginBottom="2dp" 
      android:layout_marginTop="2dp"
      android:text="@string/choose_answer" 
      android:textColor="@color/text_color"
      android:textSize="@dimen/text_size"></TextView>


   <TableLayout android:id="@+id/buttonTableLayout" 
      android:layout_width="match_parent"
      android:layout_height="wrap_content" 
      android:layout_weight="1" 
      android:stretchColumns="0,1,2,3">
      <TableRow android:id="@+id/tableRow0" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:orientation="horizontal"></TableRow>
      <TableRow android:id="@+id/tableRow1"
         android:layout_width="match_parent" 
         android:layout_height="wrap_content"
         android:orientation="horizontal"></TableRow>
      <TableRow android:id="@+id/tableRow2"
         android:layout_width="match_parent" 
         android:layout_height="wrap_content"
         android:orientation="horizontal"></TableRow>
   </TableLayout>

   <TextView android:id="@+id/answerTextView"
      android:layout_width="match_parent" 
      android:layout_height="wrap_content"
      android:textSize="@dimen/answer_size" 
      android:layout_gravity="center" 
      android:textStyle="bold" 
      android:gravity="center"></TextView>

</LinearLayout> 

I would just like to maximize the imageview such that
1. when the image width is smaller than the screen width, the image would scale up and maximize same as the screen width
2. if the image height is greater than the available space, a scrolling effect would take place for up and down
3. those guessCountryTextView and all components under the image must be shown and to be placed at bottom of the screen.

However, when i add the scrollview just like in the above code, the scrollview occupies the whole screen starting from the imageview and those undernearth like guessCountryTextView all disappears.

How could this be amended? Many thanks!

  • 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-14T07:31:06+00:00Added an answer on June 14, 2026 at 7:31 am

    Try using relativelayout instead of linear layout. use match_parent widht and fixed height for the scrollview thats all u need to do i think… have look at the code u will have to make few adjustments though.

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:id="@+id/linearLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@android:color/darker_gray" >
    
        <TextView
            android:id="@+id/titleTextView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentTop="true"
            android:text="afafafafa"
            android:textColor="@android:color/darker_gray"
            android:textSize="20sp" >
        </TextView>
    
        <TextView
            android:id="@+id/questionNumberTextView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/titleTextView"
            android:layout_gravity="center"
            android:textColor="@android:color/darker_gray"
            android:textSize="20sp" >
        </TextView>
    
        <ScrollView
            android:id="@+id/SlotScrollView"
            android:layout_width="match_parent"
            android:layout_height="250dp"
            android:layout_below="@+id/questionNumberTextView"
            android:padding="0dp"
            android:color="@android:color/black" >
    
            <ImageView
                android:id="@+id/flagImageView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:adjustViewBounds="false" >
            </ImageView>
        </ScrollView>
    
        <TextView
            android:id="@+id/guessCountryTextView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="2dp"
            android:layout_marginTop="2dp"
            android:text="sfsff"
            android:textColor="@android:color/darker_gray"
            android:textSize="20sp" >
        </TextView>
    
        <TableLayout
            android:id="@+id/buttonTableLayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_alignParentLeft="true"
            android:stretchColumns="0,1,2,3" >
    
            <TableRow
                android:id="@+id/tableRow0"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal" >
            </TableRow>
    
            <TableRow
                android:id="@+id/tableRow1"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal" >
            </TableRow>
    
            <TableRow
                android:id="@+id/tableRow2"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal" >
            </TableRow>
        </TableLayout>
    
        <TextView
            android:id="@+id/answerTextView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_toRightOf="@+id/buttonTableLayout"
            android:textSize="20sp"
            android:textStyle="bold" >
        </TextView>
    
    </RelativeLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

<?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent > I get these two errors
I use TableLayout with android. <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent> <TableLayout
This is my code: <?xml version=1.0 encoding=utf-8?> LinearLayout xmlns:android=http://schemas.android.com/apk/res/android xmlns:tools=http://schemas.android.com/tools android:layout_width=match_parent android:layout_height=match_parent android:orientation=horizontal <EditText
This is my 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=wrap_content android:orientation=vertical> <TextView android:layout_width=wrap_content
I have this code: <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:id=@+id/layoutAnim android:orientation=horizontal android:layout_width=fill_parent android:layout_height=fill_parent> <LinearLayout
<?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=fill_parent android:orientation=vertical > <ImageView android:id=@+id/venueImage android:layout_width=wrap_content android:layout_height=wrap_content/> </LinearLayout>
I've got the following xml file: <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:id=@+id/linearLayout1 android:background=@android:color/transparent android:layout_marginTop=0px
I have this XML: <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android xmlns:ads=http://schemas.android.com/apk/lib/com.google.ads android:id=@+id/LinearLayout1 android:layout_width=fill_parent android:layout_height=fill_parent android:background=@drawable/fondoverde3
My main.xml looks like this: <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent >
I use the following main.xml for my app. <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent

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.