title: Set the position of text view in android?
body: <p>this is my xml file,  </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@color/white" &gt;
  
  &lt;TextView
      android:id="@+id/datetitle"
      android:layout_width="wrap_content"
      android:layout_height="80dp"
      /&gt;
  
  &lt;ImageView
    android:id="@+id/meetingline"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:src="@drawable/meetingline"
    android:layout_marginLeft="60dp"
    android:layout_toRightOf="@+id/datetitle"
    android:visibility="gone" /&gt;
  
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>and this is code in java..</p>
  
  <pre><code>RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams)  mViewHolder.startDate.getLayoutParams();
      RelativeLayout.LayoutParams paramsImage = (RelativeLayout.LayoutParams) imgView.
     double conversion = minute*2.7;
     int topmargin = (int)conversion;
    // params.setMargins(0,topmargin,0,0);
     params.topMargin = topmargin;
     paramsImage.topMargin = topmargin+15;
         SimpleDateFormat df = new SimpleDateFormat("h:mm a");
         String date = df.format(Calendar.getInstance().getTime());
         if(hour == myList.get(position).getPosition())
         {
             mViewHolder.startDate.setLayoutParams(params);
             mViewHolder.startDate.setTextColor(Color.BLUE);
             mViewHolder.startDate =detail(convertView, R.id.datetitle, date);
             if(imgView != null)
                 imgView.setLayoutParams(paramsImage);
                 imgView.setVisibility(1);
                  imgView.bringToFront();
         }
         else{
             params.topMargin=0;
             mViewHolder.startDate.setLayoutParams(params);
             mViewHolder.startDate.setTextColor(Color.BLACK);
             imgView.setVisibility(View.INVISIBLE);
         }
  </code></pre>
  
  <p>what i am doing is i am setting the textview and image position in relative layout by setting their top margin, but it is not working right there is something going wrong, its extending the the row body, you can see the body of 4 in image i have attached with this post, please guide me how to set the position of textview and image view by not extending the body of row, and guide me what i am doing wrong by which it extends the body.<img src="https://i.stack.imgur.com/sIaec.png" alt="enter image description here"></p>