title: How to place one imageview over another?
body: <p>i want to place one <code>imageview</code> over another. The <code>imageview</code> which i want to place above is getting placed below. </p>
  
  <p>Here's my code:</p>
  
  <pre><code>for (int i = 1; i &lt;= numberofuploads; i++) {
          if (i == 1) {
              relativeframe1 = new RelativeLayout(this);
              RelativeLayout.LayoutParams paramslayout1 = new RelativeLayout.LayoutParams(
                      RelativeLayout.LayoutParams.MATCH_PARENT / 2,
                      RelativeLayout.LayoutParams.MATCH_PARENT);
              paramslayout1.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
              relativeframe1.setLayoutParams(paramslayout1);
              RelativeLayout.LayoutParams params1 = new RelativeLayout.LayoutParams(
                      pxrparams1a, pxrparams1b);
  
              imgvwphoto1 = new ImageView(this);
              imgvwphoto1.setId(1);
              imgvwphoto1.setAlpha(500);
              imgvwphoto1.setBackgroundResource(R.drawable.plusicon3);
              // params1.setMargins(0, 90, 100, 40);
  
              params1.setMargins(left1, top1, right1, bottom1);
              imgvwphoto1.setLayoutParams(params1);               
              relativeframe1.addView(imgvwphoto1);
              imgvwphoto1.setScaleType(ScaleType.MATRIX);
              imgvwphoto1.setOnTouchListener(this);               
              RelativeLayout.LayoutParams paramscomponent1 = new RelativeLayout.LayoutParams(
                      irpc1, RelativeLayout.LayoutParams.MATCH_PARENT);               
              paramscomponent1.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
  
  imgvwcomponent1 = new ImageView(this);
  imgvwcomponent1.setAlpha(0);
  imgvwcomponent1                     .setBackgroundResource(R.drawable.leftpartdoubleheartframe);
  imgvwcomponent1.setBackgroundResource(componentname.getImagename());
  imgvwcomponent1.setLayoutParams(paramscomponent1);
  
              relativeframe1.addView(imgvwcomponent1);
  
              relativeframe.addView(relativeframe1);
  
          } else {
              relativeframe2 = new RelativeLayout(this);
              RelativeLayout.LayoutParams paramslayout2 = new RelativeLayout.LayoutParams(
                      RelativeLayout.LayoutParams.MATCH_PARENT / 2,
                      RelativeLayout.LayoutParams.MATCH_PARENT);
              paramslayout2.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
              relativeframe1.setLayoutParams(paramslayout2);
              RelativeLayout.LayoutParams params2 = new RelativeLayout.LayoutParams(
                      pxrparams2a, pxrparams2b);// 106.67dp, 120dp
              imgvwphoto2 = new ImageView(this);
              imgvwphoto2.setId(2);
              imgvwphoto2.setAlpha(500);
              imgvwphoto2.setBackgroundResource(R.drawable.plusicon3);
  
              // params2.setMargins(165, 90, 0, 40);
              params2.setMargins(left2, top2, right2, bottom2);
              imgvwphoto2.setLayoutParams(params2);
              relativeframe2.addView(imgvwphoto2);
              imgvwphoto2.setScaleType(ScaleType.MATRIX);
  
              imgvwphoto2.setOnTouchListener(this);
              RelativeLayout.LayoutParams paramscomponent2 = new RelativeLayout.LayoutParams(
                      irpc2, RelativeLayout.LayoutParams.MATCH_PARENT);// 103.33dp
  
              paramscomponent2.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
  
              imgvwcomponent2 = new ImageView(this);
              imgvwcomponent2.setAlpha(500);
              imgvwcomponent2
                      .setBackgroundResource(R.drawable.rightpartdoubleheartframe);
              imgvwcomponent2.setLayoutParams(paramscomponent2);
  
              relativeframe2.addView(imgvwcomponent2);
  
              relativeframe.addView(relativeframe2);
  
          }
      }
  </code></pre>
  
  <p>on click of plus icon, image is uploaded on that imgvwphoto,that is overlaping with heart frame, i want it to be viewed inside heart frame only. not outside of heart frame.</p>