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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:23:49+00:00 2026-05-29T07:23:49+00:00

hi I have a activity with three vertical linear layout with respective layout_weight with

  • 0

hi I have a activity with three vertical linear layout with respective layout_weight with orientation vertical . I have added 10 image to left and right linear layout . Middle layout is empty.

I want to add scroll view in both left and right linear layout , so that if screen is small , then user able to scroll to see all images in linear layout .

 <?xml version="1.0" encoding="UTF-8"?>
 <LinearLayout android:id="@+id/layoutPositionRow"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:padding="8px"
android:layout_width="fill_parent" android:layout_height="fill_parent">

     <LinearLayout android:layout_width="wrap_content"
    android:layout_height="wrap_content" android:orientation="vertical"
    android:layout_weight=".2" android:layout_gravity="center_vertical">
     </LinearLayout>

    <LinearLayout android:layout_width="wrap_content"
    android:layout_height="wrap_content" android:orientation="vertical"
    android:layout_weight=".6" android:layout_gravity="center_vertical">
     </LinearLayout>

    <LinearLayout android:layout_width="wrap_content"
    android:layout_height="wrap_content" android:orientation="vertical"
    android:layout_weight=".2" android:layout_gravity="center_vertical">
     </LinearLayout>

  </LinearLayout>

Whether It is possible.

Please suggest me usable link or sample code.

  • 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-29T07:23:50+00:00Added an answer on May 29, 2026 at 7:23 am

    Just wrap your scrollable layouts into ScrollViews like in this code:

     <ScrollView
         android:layout_width="0dp"
         android:layout_height="fill_parent"
         android:layout_weight=".2">
         <LinearLayout android:layout_width="fill_parent"
            android:layout_height="fill_parent" android:orientation="vertical"
            android:gravity="center_vertical">
         </LinearLayout>
     <ScrollView>
    
    <LinearLayout android:layout_width="0dp"
         android:layout_height="fill_parent" android:orientation="vertical"
         android:layout_weight=".6" android:gravity="center_vertical">
     </LinearLayout>
    
    <ScrollView
         android:layout_width="0dp"
         android:layout_height="fill_parent"
         android:layout_weight=".2">
         <LinearLayout android:layout_width="fill_parent"
            android:layout_height="fill_parent" android:orientation="vertical"
            android:gravity="center_vertical">
         </LinearLayout>
     <ScrollView>
    

    Here, I used layout_width attribute value for all of the elements as 0dp because of using layout_weight. And also if you would like to position elements in your layouts by center_vertcial you should use android:gravity attribute instead of android:layout_gravity. The last one tells the system how to position layouts on their ScrollViews.

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

Sidebar

Related Questions

In my Android application, I have an activity with three layouts: A left layout,
I have a LinearLayout with a vertical orientation, within that layout I have three
I have a main.xml file describing the layout of my main activity: <?xml version=1.0
I have three buttons Image , Videos , Audios. I want to change the
I have activity with three GrindViews. I fill these views with custom SimpleCursorAdapters. In
In my custom list activity, I have added header in my list activity, it
I have a class that extends Activity and inflates another xml layout in the
I have three different activities sharing exactly the same layout (a ListView and a
Can some one tell me were i am going wrong. i have three activity's
I have Activity A with android:launchMode=singleTop in the manifest. If I go to Activity

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.