У меня есть RelativeLayout, содержащий Textview. Я хочу, чтобы текст TextView обернулся несколькими строками.Текст TextView не обертывается на Android 4.3
Он отлично работает на Android 4.1 и 4.2 (не пробовал более ранние версии). Однако на Android 4.3 текст не обертывается и вырезается (см. Скриншоты ниже).
layout.xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/feed_item"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/touchable_background_msf"
android:padding="@dimen/feed_item_padding" >
<com.binarymango.msfnews.images.RecyclingImageView
android:id="@+id/feed_item_icon"
android:layout_width="@dimen/feed_thumb_width"
android:layout_height="@dimen/feed_thumb_height"
android:contentDescription="Description" />
<TextView
android:id="@+id/feed_item_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/feed_item_icon"
android:layout_alignLeft="@+id/feed_item_icon"
android:layout_alignRight="@+id/feed_item_icon"
android:background="@color/text_background_msf"
android:ellipsize="end"
android:maxLines="3"
android:minLines="2"
android:padding="@dimen/feed_item_text_padding"
android:text="Description"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/text_msf" />
</RelativeLayout>
Результат на Android 4.2, текст правильно завернутые в 3 строки:
Но на Android 4.3, текст просто вырезать:
Я пытался играть с несколькими атрибутами, как указано в другом месте в StackOverflow, напрасно:
android:singleLine="false"
android:scrollHorizontally="false"
android:inputType="textMultiLine"
android:width="0dip"
Кроме того, я подозреваю, что это может иметь отношение к теме. Мое приложение использует Theme.AppCompat.Light
удалить андроид: textAppearance = "? Android: attr/textAppearanceSmall" и положить другой размер текста для другого устройства –
спасибо, но это не работает (без изменений) – muslidrikk
, в котором устройство или эмулятор вы тестируете .... –