title: how to set width which is equal to another widget on android
body: <p>I need to draw a horizontal line below a text field such that the width of the line equals the text width (not the width of the full screen).</p>
  
  <p>In my app I have a textview below a view(Horizontal line).
  The <strong>width of the line view</strong> should be equal to the <strong>width of the textview</strong>.
  I tried android:layout_width="wrap_content" and "match_parent", which does not solve the problem.</p>
  
  <p>This is xml coding sample:</p>
  
  <pre><code>         ......
          &lt;TextView
              android:id="@+id/textView1"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_alignParentTop="true"
              android:layout_centerHorizontal="true"
              android:layout_marginTop="28dp"
              android:text="PopUpWindow"
              android:textAppearance="?android:attr/textAppearanceLarge" /&gt;
  
  
              &lt;View
                  android:id="@+id/separator"
                  android:layout_width="wrap_content"
                  android:layout_height="0.3dp"
                  android:layout_below="@+id/textView1"
                  android:background="#ffffff" /&gt;
               ......
  </code></pre>
  
  <p>image of the screen is:</p>
  
  <p><img src="https://i.stack.imgur.com/fpgNy.png" alt="enter image description here"></p>
  
  <p>please help me.</p>