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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:15:56+00:00 2026-06-08T03:15:56+00:00

I have two gridviews in a linear layout. Here is my XML code: <LinearLayout

  • 0

I have two gridviews in a linear layout. Here is my XML code:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" 
    android:gravity="center"
    android:orientation="horizontal" >

   <GridView
    android:id="@+id/leftGrid2"
    android:layout_width="416dp"
    android:layout_height="1078dp"
    android:columnWidth="70dp"
    android:horizontalSpacing="5dp"
    android:numColumns="2"
    android:paddingRight="20dp"
    android:stretchMode="columnWidth"
    android:verticalSpacing="5dp" >

  </GridView>

   <GridView
    android:id="@+id/rightGrid2"
    android:layout_width="400dp"
    android:layout_height="match_parent"
    android:columnWidth="70dp"
    android:horizontalSpacing="5dp"
    android:numColumns="2"
    android:stretchMode="columnWidth"
    android:verticalSpacing="5dp" >

    </GridView>
  </LinearLayout>

How to make these two grid views scroll together or synchronize them ? They have two seperate scrolls when i run my application.

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-08T03:15:58+00:00Added an answer on June 8, 2026 at 3:15 am

    GridView is provided the smoothScrollToPosition(int) method via its AbsLisView parent. This will scroll to the position you desire. Now, you listen for ScrollEvent with the OnScrollListener. Now just tie these together:

    GridView other;
    @Override public void onScroll(AbsListView view, int firstItem, int visItems, int total) {
        other.smoothScrollToPosition(firstItem);
    }
    

    Now, this will not! work as expected if your two views are not comparable ie. same content quantity.

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

Sidebar

Related Questions

I have a LinearLayout in my android application. Worked well with just the two
I have some wpf gridviews(presenting only two here) <igDP:XamDataGrid x:Name=dgSummary GroupByAreaLocation=None ScrollingMode=Immediate HorizontalAlignment=Stretch VerticalAlignment=Stretch
I have two files client.php and server.php. The client file send a HTTP request
I have two GridViews that list out included and exclude data items respectively. By
I am learning ASP.NET and I have a master-detail scenario using two GridViews in
I have two GridViews layed out side by side. The first GridView contains variable
I have two GridViews. One is Source GridView and another one is Destination GridView.
I have two GridViews namely GridView1 and GridView2 .They are in same Location and
I have two GridViews, the first works fine as I defined the datasource when
I have two files named as TimeSheet.aspx.cs and TimSheet.aspx ,code of the file are

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.