title: Horizontal scrolling grid view
body: <p>I know it is not possible in Android to scroll grid view horizontally. But what I am doing is adding image buttons dynamically inside horizontal scroll view like this:</p>
  
  <pre><code>public class HorizontalScroller extends Activity {
      static int l=0;
       private Rect mTempRect = new Rect();
  
      static int r1=0;
      static int t=0;
      static int b=0;
      static int x=0;
      static int y=0;
   //Button[]  b1 = new Button[100];
      ImageButton btn[][] = new ImageButton[10][10];
  
   //ImageButton b1 = new ImageButton(this);
      /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
          LinearLayout rl = (LinearLayout)findViewById(R.id.widget92);
  
          LinearLayout.LayoutParams params1 = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
  
          for(int i=0;i&lt;4;i++)
          {
              for(int j=0;j&lt;10;j++)
              {System.out.println("helo");
          /*      l=l+100;
                  r1=r1+100;
                  t=t+100;
                  b=b+100;*/
              //button();
         //ImageButton btn=new ImageButton(this);
     /*    Rect r = mTempRect;
             r.left=10;
             r.top=10;
             r.right=10;
             r.bottom=10;
         btn[i][j].getDrawingRect(r);*/
  
              //btn[i][j].setId(j);
  
                Rect r = mTempRect;
                r.set(0,0,0,0);
                Rect r2 = mTempRect;
                r2.set(0,20,0,20);
  
                  btn[i][j]=new ImageButton(this);
                  btn[i][j]. setBackgroundResource(R.drawable.icon);
                  btn[i][j].setMinimumWidth(20);
                  btn[i][j].setMinimumHeight(20);
                  params1.setMargins(5, 5, 5,5); 
                  rl.addView(btn[i][j],params1); 
  
                 System.out.println("1="+btn[i][j].getTop());
                 System.out.println("2="+btn[i][j].getLeft());
                 System.out.println("3="+btn[i][j].getRight());
                 System.out.println("4="+btn[i][j].getBottom());
              }
          }
      }
  }
  </code></pre>
  
  <p>but I am getting all image buttons in a single line.  How can I implement them in a grid like structure? </p>