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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T15:11:48+00:00 2026-05-29T15:11:48+00:00

I am building a view in my Android application which should scroll both horizontal

  • 0

I am building a view in my Android application which should scroll both horizontal and vertical. Therefore I have surrounded my view with a horizontal scroll view and inside this horizontal scroll view I have another scroll view (vertical scroll view).

In the top of the scroll view I have a timeline (red in the illustration). When scrolling the vertical scroll view, the timeline should be static. It should stay in top. So this timeline is visible in the top at all times.

In the left of these scroll views, I have five buttons (different colors in the illustration). These buttons should scroll with the vertical scroll view but not the horizontal scroll view, meaning these should be visible in the left side at all times.

The white area in the scroll view will scroll both ways.

I have managed to have the timeline (red in the illustration) stay at top and only scroll with the horizontal scroll view but I cannot figure out where I should put my five buttons to make sure, that these will also stay on top and only scroll with the vertical scroll view.

This is my layout as it is now with the timeline staying at top.

<!-- Horizontal scroll view -->
<HorizontalScrollView android:id="@+id/schedule_concerts_scroll_view" 
                      android:layout_width="wrap_content"
                      android:layout_height="fill_parent" 
                      android:fadingEdge="none" 
                      android:scrollbars="none"
                      android:layout_below="@+id/schedule_day_pager_layout">

    <!-- Scroll container for horizontal scroll view -->
    <RelativeLayout android:layout_width="wrap_content"
                    android:layout_height="fill_parent"
                    android:id="@+id/schedule_layout">

        <!-- The timeline (red in the illustration) Should only scroll horizontal and stay at top -->
        <RelativeLayout android:id="@+id/schedule_timeline"
                        android:layout_width="wrap_content"
                        android:layout_height="23dp"
                        android:layout_marginBottom="0dp"
                        android:layout_alignParentTop="true" />

        <!-- Vertical scroll view -->
        <ScrollView android:layout_height="wrap_content"
                    android:layout_width="wrap_content"
                    android:fadingEdge="none"
                    android:scrollbars="none"
                    android:layout_below="@+id/schedule_timeline">

            <!-- Scroll container for vertical scroll view -->
            <RelativeLayout android:layout_width="wrap_content"
                            android:layout_height="wrap_content">

                <!-- The content here should be scrolling both ways -->

            </RelativeLayout>

        </ScrollView>

    </RelativeLayout>

</HorizontalScrollView>

This is the illustration, I have been referring to. This should help explain how my layout should end up.

Illustration of scroll directions

Does anyone know how I can achieve the scroll in both directions with views having a fixed position for both directions?

  • 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-29T15:11:48+00:00Added an answer on May 29, 2026 at 3:11 pm

    I found that it was easy to move the buttons on the left side out of both of the scroll views and listen for onScrollChanged and whenever the vertical scroll view was scrolled, then scroll the buttons accordingly. Therefore I put the buttons inside a scroll view and called onScroll() on this scroll view when onScrollChanged() was called.

    For a great description on how to extend ScrollView to implement onScrollChanged() see, this answer.

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

Sidebar

Related Questions

I'm building an android application, which has a list view, and in the list
I am building an Android application that requires OAuth. I have all the OAuth
I am currently building this Android application, where I will be taking a screenshot
I'm creating an application for android which is a 3D inside navigation system of
I'm new to Android and I'm building an application which uses ListViews. A ListView
I am building an android application which has a listview and when the user
In an android activity I have a lenghty process in building a report (view).
I am building an android app in which I have to add a background
I am absolutely new to the Android platform and have been building an application
I'm building an application using the Supervising Controller pattern (Model View Presenter) and I

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.