У меня есть некоторые проблемы с переносом текста в моем приложении.Как обернуть текст в TexView Android
Вот мой макет:
<GridLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:columnCount="2"
android:orientation="horizontal"
android:rowCount="2" >
<ImageView
android:id="@+id/img"
android:layout_width="150dp"
android:layout_height="225dp"
android:layout_gravity="left|top"
android:layout_column="0"
android:layout_rowSpan="2"
android:contentDescription="@string/imgdesc" />
<TextView
android:id="@+id/tvName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_column="1"
android:layout_marginLeft="20dp"
android:layout_row="0"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/tvDescription"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_gravity="fill_horizontal"
android:layout_marginLeft="20dp"
android:layout_marginTop="10dp"
android:layout_row="1"/>
</GridLayout>
И вот результат:
Как вы можете видеть, часть текста из экрана, и я не действительно знаю, как это исправить.
попытался с помощью 'wrap_content' для ширины tvDescription в? – Darpan
да я. На самом деле сначала это было 'wrap_content', я попробовал' fill_parent' и забыл изменить его, когда я скопировал свой код. –
Я пытался дать фиксированную ширину, это сработало, но почему gridlayout btw? Если не по какой-либо причине, то этот макет может быть реализован с помощью RelativeLayout. – Darpan