android - Textview width doens't adjust after change content -


i'm trying update content of textview data introduced edittext. after change text, if original text (hint) bigger new text, width doens't change.

i have next string in hint attribute of textview, "please, introduce amount". if put 25'5, example, textview doesn't resize width.

first screen first screen

second screen second screen

the euro symbol invisible behind textview, , it's shown after insert value.

the piece of code amount:

<relativelayout                 android:id="@+id/rlimporte"                 android:layout_width="match_parent"                 android:layout_height="wrap_content"                 android:background="@drawable/rel_layout_colors"                 android:clickable="true"                 android:paddingtop="8dp"                 android:paddingbottom="8dp">                  <imageview                     android:id="@+id/lst_img3"                     android:layout_width="50dp"                     android:layout_height="50dp"                     android:layout_alignparentleft="true"                     android:layout_alignparenttop="true"                     android:layout_margin="5sp"                     android:layout_margintop="5dp"                     android:src="@drawable/icon_importe"/>                  <textview                     android:id="@+id/tvimporte"                     android:layout_width="wrap_content"                     android:layout_height="wrap_content"                     android:layout_alignparenttop="false"                     android:layout_margintop="5dp"                     android:layout_torightof="@+id/lst_img3"                     android:text="@string/importe_title_string"                     android:textcolor="@android:color/black"                     android:textsize="@dimen/title_text_size" />                  <textview                     android:id="@+id/tvimportedesc"                     android:layout_width="wrap_content"                     android:layout_height="wrap_content"                     android:layout_below="@+id/tvimporte"                     android:layout_torightof="@+id/lst_img3"                     android:textcolor="@android:color/darker_gray"                     android:textsize="@dimen/subtitle_text_size"                     android:visibility="visible"                     android:hint="@string/importe_placeholder_string"                     android:textcolorhint="@android:color/darker_gray"                     android:ellipsize="start"                     android:layout_marginright="4dp" />                  <textview                     android:id="@+id/tveurosymbol"                     android:layout_width="match_parent"                     android:layout_height="wrap_content"                     android:layout_below="@+id/tvimporte"                     android:layout_torightof="@+id/tvimportedesc"                     android:textcolor="@android:color/darker_gray"                     android:textsize="@dimen/subtitle_text_size"                     android:visibility="gone"                     android:hint="@string/euro_symbol"                     android:textcolorhint="@color/blue_quantion"                     android:ellipsize="start"                     android:paddingleft="4dp" />              </relativelayout> 

you seem want change width of tvimportedesc dynamically. short of android not allow this, though people have developed work arounds. (toggling visibility answers suggest did not work me). similar questions:

change relative layout width , height dynamically

wrap_content not working after dynamically adding views

since trying fit text on same line might easier use single textview line of text, , concatenate euro symbol?


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -