title: Setting Layout parameters in android
body: <p>Working with the XML file was easy as I could specify the parameters as </p>
  
  <pre><code>&lt;android:layout_width="fill_parent" android:layout_height="wrap_content"&gt;
  </code></pre>
  
  <p>But I am confused while specifying it through code. For each view I specify the parameters using </p>
  
  <pre><code>view.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.FILL_PARENT)); 
  </code></pre>
  
  <p>I see that I have an option of specifying it as relative layout, frame layout etc.
  As of now I am using linear layout for all views such as images, text and also gridview. Should the view parameters be defined based on the layout of the parent element? Or is it OK to specify it as linear layout even if the view is a child of, say, a framelayout? Sorry, but I couldn't find out the difference.</p>