Ich habe eine TextView
innerhalb einer LinearLayout
, die nur einen Teil des Textes ohne Umbruch auf einen Zeilenumbruch zeigt und nicht verstehen warum. Es zeigt nicht einmal die Ellipse irgendwo. DieTextView nicht mehrlinear
TextView
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/import_progress_text"
android:singleLine="false"
android:maxLines="4"
android:ellipsize="end"
style="@style/TxtDefault" />
Ich habe auch versucht layout_weight=0
zusammen mit layout_height=0
aber noch kein Glück. Alle Geschwister innerhalb der LinearLayout
haben layout_height=wrap_content
festgelegt.
EDIT
Okay, anscheinend funktioniert es, wenn eine feste Breite festgelegt ist, aber weder mit fill_parent
noch mit match_parent
. Ist das das erwartete Verhalten?
Per Anfrage das gesamte Layout
Beachten Sie, dass im Inneren des FrameLayout andere unsichtbar ist, das ist ziemlich lang
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
style="@style/ContentBody"
>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="@+id/progress"
android:layout_gravity="center">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/import_progress_title"
style="@style/TxtTitle" />
<TextView
android:layout_width="410dp"
android:layout_height="wrap_content"
android:text="@string/import_progress_text"
android:singleLine="false"
android:maxLines="4"
android:ellipsize="end"
style="@style/TxtDefault" />
<ProgressBar
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="410dp"
android:layout_height="wrap_content"
android:id="@+id/progress_bar_view"
android:progress="2"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/import_progress_start"
android:id="@+id/progress_text_view"
style="@style/TxtSecondary" />
</LinearLayout>
</FrameLayout>
bitte fügen Sie das komplette Layout xml, danke –
Textansicht layout_width sollte "wrap_content" sein – randy