android - LinearLayout doesn't show view -


i'm using linearlayout doesn't show every view.

this xml-code:

<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> 

there more controls contained enough demonstrate problem.

this should draw black rectangle. right vertical line missing. why?

just add weight inner linearlayout android:layout_width="0dp" , android:layout_weight="1"

<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" >  <view     android:layout_width="1dp"     android:layout_height="match_parent"     android:background="#ff000000" />  <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="0dp"     android:layout_weight="1"     android:layout_height="wrap_content"     android:orientation="vertical"     >      <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="hola"/>     <view         android:layout_width="match_parent"         android:layout_height="1dp"         android:background="#ff000000" /> </linearlayout>  <view     android:layout_width="1dp"     android:layout_marginright="5dp"     android:layout_height="match_parent"     android:background="#ff000000" /> 


Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -