У меня есть два TextView в LinearLayout с горизонтальной ориентацией. Если второй текстовый вид превышает определенную длину, он оказывается ниже одного и того же текстового вида вместо добавления в качестве следующей строки. Как я могу принести текст Text-view секунд в следующей строке.Текст BringTextView в следующей строке
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<TextView
android:id="@+id/notificationText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Sample text1 Sample text1 Sample text1" />
<TextView
android:id="@+id/notificationText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Sample text2 Sample text2 Sample text2" />
</LinearLayout>
Добавить 'android: orientation =" vertical "' to ur linearlayout – prabhakaran
попробуйте 'android: maxLines =" 2 "' в ваш 'TextView' –
hmm ... Может быть, вы хотите горизонтально в коротком тексте и вертикально, когда долго? – ytRino