Android Textview Text Not Getting Wrapped

Android TextView Text not getting wrapped

I fixed it myself, the key is android:width="0dip"

<LinearLayout 
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="4dip"
android:layout_weight="1">

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="4dip">

<TextView
android:id="@+id/reviewItemEntityName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/maroon"
android:singleLine="true"
android:ellipsize="end"
android:textSize="14sp"
android:textStyle="bold"
android:layout_weight="1" />

<ImageView
android:id="@+id/reviewItemStarRating"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true" />
</LinearLayout>

<TextView
android:id="@+id/reviewItemDescription"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="12sp"
android:width="0dip" />

</LinearLayout>

<ImageView
android:id="@+id/widget01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/arrow_nxt"
android:layout_gravity="center_vertical"
android:paddingRight="5dip" />

</LinearLayout>

android textview not wrapping correctly

 <TextView
android:id="@+id/rowCreatedAt"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="10dp"
android:textColor="#ff696969"
android:ellipsize="none"
android:singleLine="false"
android:scrollHorizontally="false"
android:layout_weight="1"
android:maxLines="100"
android:text="Android Textview Text Not Getting Wrappedaaaaaaabbbbbb" />

Change android:layout_width="fill_parent" to android:layout_width="200dp"

Android: Programmatically added Textview not wrapping text to next line

Alright for anyone who has the same problem (I doubt it but still) Here is what fiex it for me. I recalculated the Width and Height of my views to dip's with a function (geefIntAsDp which I have written in a different helper). This works fine with normal Integers but you can't use it with wrap_content or match_parent. So all I needed to do was delete this conversion and it worked.

Android TextView Text wont wrap on Listview

problem solved. it turns out android studio didnt update my changes when i ran my app. i uninstalled the app and then run it again and it works perfectly.



Related Topics



Leave a reply



Submit