title: Setting image view absolute position
body: <p>I'm trying to manually set the image-view position within my app, the code is currently working but all the facebook images display at the top right and side on top of each other. </p>
  
  <p>I do not have access to any adaptors, this is within the Facebook SDK, can anyone spot any problems with the following code:</p>
  
  <p>My XML:</p>
  
  <p>DisplayPhotos.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/DisplayPhotosLayout"
      android:layout_width="match_parent"
      android:layout_height="match_parent" &gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>This is set by the following:</p>
  
  <pre><code>fbManager = new FBLoginManager(this, R.layout.displayphotos, "-------", permissions);
  </code></pre>
  
  <p>Then I use the following to display images (working but all in same position)</p>
  
  <pre><code>int Row = 0;
      int RowCount = 0;
      int imageWidth = (int)getWindowManager().getDefaultDisplay().getWidth() / 3;
  
      for(int _i = 0; _i &lt; _noOfPhotos; _i++)
      {
          ImageView imageView = new ImageView(getApplicationContext());
          imageView.setImageResource(R.drawable.no_image);
  
          RelativeLayout.LayoutParams rl = new RelativeLayout.LayoutParams(imageWidth, imageWidth);
          rl.setMargins(imageWidth * _i, imageWidth * Row, 0,0);
  
          RowCount = RowCount + 1;
  
          if(RowCount == 3){Row = Row + 1;RowCount = 0;}
  
          UrlImageViewHelper.setUrlDrawable(imageView, _userGallery.get(_i).getPicture());
  
          addContentView(imageView, rl);
  
          System.out.println(imageWidth * _i + " top: " + imageWidth * Row);
  
          _imageViewArray.add(imageView);
      }
  </code></pre>