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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:30:08+00:00 2026-06-11T12:30:08+00:00

How can I make a Linear layout horizontally scrollable? I just wrap a linear

  • 0

How can I make a Linear layout horizontally scrollable? I just wrap a linear layout in myscrollview, I did what’s needed in my XML file too but it still cannot scroll horizontally for contents which exceeds the linear layout size. Here is my XML:

    <ScrollView 
        android:id="@+id/scroller"
        android:layout_marginTop="16dip"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/popup"
        android:fadingEdgeLength="5dip"
        android:scrollbars="horizontal"
        android:overScrollMode="always" 
        android:isScrollContainer="true" 
        android:scrollbarAlwaysDrawHorizontalTrack="true"
        >

        <LinearLayout
            android:id="@+id/tracks"
            android:orientation="horizontal"
            android:layout_width="wrap_content"
            android:layout_height="fill_parent"
            android:layout_weight="1"
            android:padding="10dip"/>

    </ScrollView >

    <ImageView
        android:id="@+id/arrow_up"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/arrow_up" />

    <ImageView
        android:id="@+id/arrow_down"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/scroller"
        android:layout_marginTop="-4dip"
        android:src="@drawable/arrow_down" />

</RelativeLayout>
  • 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-11T12:30:09+00:00Added an answer on June 11, 2026 at 12:30 pm

    check this link http://android.okhelp.cz/horizontalscrollview-scrollview-horizontal-vertical-android-xml-example/

     import android.app.Activity;
     import android.content.Intent;
     import android.os.Bundle;
     import android.view.View;
     import android.view.View.OnClickListener;
     import android.widget.Button;
     import android.widget.ImageButton;
    
      public class HorizontalscroolActivity extends Activity {
    
    
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    
        ImageButton btn11 = (ImageButton) findViewById(R.id.imageButton1);
    
    
        ImageButton btn2 = (ImageButton) findViewById(R.id.imageButton2);
    
    
        ImageButton btn3 = (ImageButton) findViewById(R.id.imageButton3);
    
    
        ImageButton btn4 = (ImageButton) findViewById(R.id.imageButton4);
    
    
    }
    
      }
    

    In XMLFILE

    <?xml version="1.0" encoding="utf-8"?>
    <HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content">
        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent">
            <LinearLayout
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:orientation="vertical">
                <ImageButton
                    android:id="@+id/imageButton1"
                    android:layout_width="wrap_content"
                    android:layout_height="100dp"
                    android:src="@drawable/pic7"
                    android:text="image1" />
                <TextView
                    android:id="@+id/text"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center"
                    android:text="Textview1" />
            </LinearLayout>
            <LinearLayout
                android:layout_width="fill_parent"
                android:orientation="vertical"
                android:layout_height="fill_parent">
                <ImageButton
                    android:text="image2"
                    android:id="@+id/imageButton2"
                    android:layout_width="wrap_content"
                    android:layout_height="100dp"
                    android:src="@drawable/pic2" />
                <TextView
                    android:id="@+id/text"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center"
                    android:text="Textview2" />
            </LinearLayout>
            <LinearLayout
                android:layout_width="fill_parent"
                android:orientation="vertical"
                android:layout_height="fill_parent">
                <ImageButton
                    android:text="image3"
                    android:id="@+id/imageButton3"
                    android:layout_width="wrap_content"
                    android:layout_height="100dp"
                    android:src="@drawable/pic7" />
                <TextView
                    android:id="@+id/text"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center"
                    android:text="Textview3" />
            </LinearLayout>
            <LinearLayout
                android:layout_width="fill_parent"
                android:orientation="vertical"
                android:layout_height="fill_parent">
                <ImageButton
                    android:text="image4"
                    android:id="@+id/imageButton4"
                    android:layout_width="wrap_content"
                    android:layout_height="100dp"
                    android:src="@drawable/pic5" />
                <TextView
                    android:id="@+id/text4"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center"
                    android:text="Textview4" />
            </LinearLayout>
        </LinearLayout>
    </HorizontalScrollView>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can make my program write a .dat file with an array of Node
I can make a single row IKImageBrowserView by setting the [imageBrowser setContentResizingMask:NSViewWidthSizable]; but in
I can make batch or vbs file on windows and run. this can automate
In GNUPlot you can make 3d plots based on a .dat file with a
I'm trying to make a scrollable horizontal menu using HorizontalScrollView using the layout shown
Can anyone tell me how to make my sample below <?xml version=1.0 encoding=utf-8?> <LinearLayout
How can I make columns in Android ListView? I have this list item layout
How can make a link within a facebox window that redirects it to another
I can make a variable's name from two variables' value: $a = 'tea'; $b
I can make a log in for easily, so that's not the problem. What

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.