title: ImageView width to be 50 percent of Device width Android
body: <p>before I start I should say that I'm a beginner in Android development :)
  I am using a Grid <code>recyclerView</code> and have set the number of columns to 2.
  I only have one <code>ImageView</code> in my <code>cardView</code> and I don't know how to make this card (or Image) to be 50% of screen width, because when I set its height and width with numbers then I get problems on different screen sizes.</p>
  
  <p>I read and tried some ways with <code>layout_weight</code> but it doesn't work with this <code>cardView</code>.</p>
  
  <blockquote>
    <p>card.xml</p>
  </blockquote>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="horizontal"
      android:layout_width="200dp"
      android:layout_height="200dp"
      &gt;
  
      &lt;ImageView
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:id="@+id/list_photo_double_view"
          android:src="@drawable/e48"
          /&gt;
  
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>How can I do that here?</p>
  
  <p>Thanks in advance</p>