Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to adjust the width of Android TextView dynamically
    primarykey
    data
    text
    <p>I have RelativeLayout in which I place a TextView to the left of a button which is alligned parent right. So, when the text to be displayed in TextView increases more than wrap_Content then it overlaps on Button. So, I need a solution to display the exceeded Text in next line. Can anyone help me in sorting out this issue ? <br> In the below layout if the TextView2's Text is "11111111111111111111111" it will overlap with TextView1 . How to prevent that ? <br> my layout is as below : </p> <pre><code> &lt;ImageView android:id="@+id/imageView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_centerVertical="true" android:layout_margin="10dp" android:scaleType="fitXY" android:src="@drawable/icon" &gt; &lt;/ImageView&gt; &lt;TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/imageView1" android:layout_margin="5dp" android:text="TextView" android:textSize="22dp" android:layout_toRightOf="@id/imageView1" &gt; &lt;/TextView&gt; &lt;Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:focusable="false" android:text="Button" android:layout_alignTop="@+id/imageView1" &gt; &lt;/Button&gt; &lt;TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toLeftOf="@id/button1" android:text="TextView222" android:textSize="22dp" android:layout_margin="5dp" android:layout_alignTop="@+id/imageView1" android:ellipsize="end" &gt; &lt;/TextView&gt; </code></pre> <p></p> <p><br> In the above layout if the TextView2's Text is "11111111111111111111111" it will overlap with TextView1 . How to prevent that</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload