title: how to change the x of view in relativelayout in android
body: <p>i have a view in relativeleayout , I want to change the place of the view to the middle of  relativeleayout:<br>
  what is the problém </p>
  
  <pre><code>     RelativeLayout partieoption = (RelativeLayout) findViewById(R.id.partieoption);
          int wpartieoption =partieoption.getWidth();
       int hpartieoption = partieoption.getHeight();
        ImageView x = (ImageView) findViewById(R.id.photo2);
        x.setX( (float) ( hpartieoption/2 ) );
  </code></pre>
  
  <p>the xml : </p>
  
  <p>
  
  <pre><code>                    android:id="@+id/partieoption"
                      android:layout_width="fill_parent"
                      android:layout_height="fill_parent"
                      android:weightSum="6"
                      android:orientation="horizontal"
                      &gt;
  
  
  
  
                          &lt;ImageView 
                              android:id="@+id/photo2"
                              android:src="@drawable/loglog"
                              android:layout_width="50dp"
                              android:layout_height="50dp"
                              /&gt;
  
  
  
  
                 &lt;/RelativeLayout&gt;
  </code></pre>