title: Layout width programmatically?
body: <p>I am doing a layout programmatically.My problem is i can not giving width white area?How can i do that.and i can not align to right and center arrow?</p>
  
  <p>My code:</p>
  
  <pre><code>      public infoline(Context context) {
          super(context);
          this.setBackgroundResource(R.drawable.all_line);
          new MarginLayoutParams(MarginLayoutParams.FILL_PARENT, MarginLayoutParams.FILL_PARENT);
  
          areaPic=new ImageView(getContext());
          areaPic.setBackgroundResource(R.drawable.profil_photo);
  
  
          mainLayout=new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
          mainLayout.setMargins(10,10,10,10);
          addView(areaPic, mainLayout);
  
          next=new ImageView(getContext());
          next.setBackgroundResource(R.drawable.ok_12_22dip);
  
          LinearLayout.LayoutParams nextlayout =new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT);
          nextlayout.gravity = Gravity.RIGHT;
          nextlayout.topMargin=10;
          addView(next,nextlayout);
  
  }
  </code></pre>
  
  <p>xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:layout_width="360dip"
                android:layout_height="480dip"&gt;
      &lt;ScrollView
          android:layout_height="250dip"
          android:layout_width="360dip"
          android:id="@+id/scrolline_search"&gt;
          &lt;LinearLayout android:layout_height="wrap_content"
                        android:layout_width="200dip"
                        android:id="@+id/addline_search"&gt;
  
          &lt;/LinearLayout&gt;
  
          &lt;/ScrollView&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>