Я использую LinearLayout
, который не отображает каждый вид.LinearLayout не показывает вид
Это XML-код:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="160dp"
android:layout_height="wrap_content"
android:orientation="horizontal"
tools:context="de.schumann_connection.yahtzee.DescriptionColumnFragment">
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#FF000000" />
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
tools:context="de.schumann_connection.yahtzee.DescriptionColumnFragment">
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#FF000000" />
<TextView
android:layout_width="wrap_content"
android:layout_height="43dp"
android:text=""/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#FF000000" />
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#FF000000" />
</LinearLayout>
Есть гораздо больше элементов управления, содержащихся, но этого достаточно, чтобы продемонстрировать эту проблему.
Это должно нарисовать черный прямоугольник. Но правильная вертикальная линия отсутствует. Почему?
Ничего себе, что работает - но я не понимаю, почему. –
вы используете всю ширину с помощью android: layout_width = "match_parent", используя вес, который вы избегаете проблемы;) –
, если вы найдете ответ подходящим, отметьте как было разрешено;) –