Reputation: 893
I've this xml for a custom row in a ListView cell, but the TextView 'commentTextView' is getting wrapped, and doesn't respect his father width.
<!-- top left bend -->
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<ImageView style="@style/FormImageViewTopLeftBendStyle"
android:contentDescription="@string/none"
/>
</TableRow>
<!-- top left bend -->
<!-- Photo & Comment -->
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<!-- User Photo -->
<ImageButton style="@style/FormBasicStyle"
android:id="@+id/userImage"
android:background="@drawable/ic_default_user"
android:contentDescription="@string/user_photo_description"
/>
<!-- User, Comment & Time -->
<TextView
android:id="@+id/commentTextView"
style="@style/FormTextViewStyle"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="0dp"
android:background="@color/yellow"
android:singleLine="false"
android:text="@string/the_text_commented"
/>
</TableRow>
</TableLayout>
What I have to do to make a multiline TextView that doesn´t gets wrapped?
Upvotes: 0
Views: 481
Reputation: 8849
Remove this
android:layout_width="wrap_content"
android:layout_height="match_parent"
And add a layout weight element with weight other than 0
android:layout_weight="1"
It's worked for me. But i couldn't find what's happening there.
Upvotes: 1
Reputation: 17401
set layout_width to match_parent
android:layout_width="match_parent"
Upvotes: 0