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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T13:35:58+00:00 2026-05-19T13:35:58+00:00

This is more of a mass answer than a question, I just don’t know

  • 0

This is more of a mass answer than a question, I just don’t know how to post it as such, moderators if you could inform me if there even is such a thing.

This question was asked to death, and then I needed to do something similar so I work out this. The answer to this post is how to create a 3×3 Bidirectional Scroll View in android

  • 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-19T13:35:59+00:00Added an answer on May 19, 2026 at 1:35 pm

    The following is how to create a Bidirectional Scrolling View

    Place a gallery into a GridView with one column and column size set to fill the parent view (or something to that effect). Place a gallery into the GridView and set its height in LayoutParams to the height of the drawables/views you want to occupy them. All you need to do then is when one gallery is moved to move all the others in the grid view. I’ll post the code below. Note: the code I did is a test of concept that works, I just tried it on my phone. As such however, it is not flashy. As I continue to work on It I may update the code to make it look nicer.

    ~Aedon 🙂

    This is a general answer to questions like:
    How to make a 2-dimension image gallery with both horizontal and vertical scrolling?

    GridView with horizontal scroll

    public class Test extends Activity {
    /** Called when the activity is first created. */
    GridView gv;
    Gallery g[] = new Gallery[3];
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        gv = (GridView)findViewById(R.id.gridview);
        gv.setAdapter(new GAdapter());
        for (int i = 0; i < g.length; i++) {
            g[i] = new Gallery(this);
            g[i].setAdapter(new GGAdapter());
            g[i].setOnTouchListener(new OnTouchListener() {
                @Override public boolean onTouch(View arg0, MotionEvent ev) {
                    if (ev.getAction() == MotionEvent.ACTION_UP) {
                        for (int j = 0; j < g.length; j++) {
                            g[j].setSelection(((AdapterView)arg0).getSelectedItemPosition());
                        }
                    }
                    return false;
                }
            });
        } 
    }
    
    private class GAdapter extends BaseAdapter {    
        public GAdapter() {}
        @Override public int getCount() {return g.length;}
        @Override public Object getItem(int pos) {return pos;}
        @Override public long getItemId(int pos) {return pos;}
        @Override public View getView(final int pos, View convertView, ViewGroup parent) {
    
            g[pos].setLayoutParams(new GridView.LayoutParams(gv.getWidth(), gv.getHeight()));           
            return g[pos];
        }
    }
    
    private class GGAdapter extends BaseAdapter {       
        int[] images = new int[] {R.drawable.icon,
                R.drawable.icon,
                R.drawable.icon};
        public GGAdapter() {}
        @Override public int getCount() {return images.length;}
        @Override public Object getItem(int pos) {return pos;}
        @Override public long getItemId(int pos) {return pos;}
        @Override public View getView(final int pos, View convertView, ViewGroup parent) {
            ImageView mIV = new ImageView(Test.this);
            mIV.setBackgroundResource(images[pos]);
            mIV.setLayoutParams(new Gallery.LayoutParams(gv.getWidth(), gv.getHeight()/3));         
            return mIV;
        }
    }
    

    }

    and my xml file:

    <?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">
    <GridView xmlns:android="http://schemas.android.com/apk/res/android" 
        android:id="@+id/gridview"
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent"
        android:numColumns="1"
        android:verticalSpacing="10dp"
        android:horizontalSpacing="10dp"
        android:gravity="center"/>
     </LinearLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This more of a style question, rather than a how to. So I've got
This is more of an academic inquiry than a practical question. Are there any
I want to know this more in detail. Is it a realtime scheduler? An
Ok, I'm going to try to make this more clear because my last question
This is more of a specific question on a specific case. Here is what
This is more of a design question. I am working on a website and
This is more of an generic XML Schema question, but if and how do
This more a question about the why then 'how-to', yet it has been annoying
To make this more clear, I'm going to put code samples: $file = fopen('filename.ext',
I am wondering if there is a way to handle this more elegantly. After

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.