java - Android layout weight doesen't work? -


here's problem. have 3 layouts. each includes 1 of other layouts. full_schedule includes 6 day_layouts. each day_layout includes 15 class_layouts. full_schedule should have each day_layout match screen width, ends wraping content.

full_schedule layout:

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     android:id="@+id/full_schedule"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:orientation="vertical" >        <horizontalscrollview         android:id="@+id/horizontalscrollview1"         android:layout_width="match_parent"         android:layout_height="match_parent" >               <linearlayout             android:layout_width="match_parent"             android:layout_height="match_parent"             android:orientation="horizontal"             android:weightsum="1" >              <include                 android:layout_width="0dp"                 android:layout_height="wrap_content"                 android:layout_weight="1"                 layout="@layout/day_schedule" />              <include                 android:layout_width="0dp"                 android:layout_height="wrap_content"                 android:layout_weight="1"                 layout="@layout/day_schedule" />              <include                 android:layout_width="0dp"                 android:layout_height="wrap_content"                 android:layout_weight="1"                 layout="@layout/day_schedule" />              <include                 android:layout_width="0dp"                 android:layout_height="wrap_content"                 android:layout_weight="1"                 layout="@layout/day_schedule" />                 <include                 android:layout_width="0dp"                 android:layout_height="wrap_content"                 layout="@layout/day_schedule"                 android:layout_weight="1" />              <include                 android:layout_width="0dp"                 android:layout_height="wrap_content"                 layout="@layout/day_schedule"                 android:layout_weight="1"                  />          </linearlayout>     </horizontalscrollview>  </linearlayout> 

day_schedule layout:

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     android:id="@+id/day_schedule"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:orientation="vertical" >        <scrollview         android:id="@+id/scrollview1"         android:layout_width="match_parent"         android:layout_height="match_parent" >              <linearlayout             android:layout_width="match_parent"             android:layout_height="match_parent"             android:orientation="vertical" >              <include                 android:layout_width="match_parent"                 android:layout_height="wrap_content"                 layout="@layout/class_schedule" />              <include                 android:layout_width="match_parent"                 android:layout_height="wrap_content"                 layout="@layout/class_schedule" />              <include                 android:layout_width="match_parent"                 android:layout_height="wrap_content"                 layout="@layout/class_schedule" />              <include                 android:layout_width="match_parent"                 android:layout_height="wrap_content"                 layout="@layout/class_schedule" />              <include                 android:layout_width="match_parent"                 android:layout_height="wrap_content"                 layout="@layout/class_schedule" />              <include                 android:layout_width="match_parent"                 android:layout_height="wrap_content"                 layout="@layout/class_schedule" />              <include                 android:layout_width="match_parent"                 android:layout_height="wrap_content"                 layout="@layout/class_schedule" />              <include                 android:layout_width="match_parent"                 android:layout_height="wrap_content"                 layout="@layout/class_schedule" />              <include                 android:layout_width="match_parent"                 android:layout_height="wrap_content"                 layout="@layout/class_schedule" />              <include                 android:layout_width="match_parent"                 android:layout_height="wrap_content"                 layout="@layout/class_schedule" />              <include                 android:layout_width="match_parent"                 android:layout_height="wrap_content"                 layout="@layout/class_schedule" />              <include                 android:layout_width="match_parent"                 android:layout_height="wrap_content"                 layout="@layout/class_schedule" />              <include                 android:layout_width="match_parent"                 android:layout_height="wrap_content"                 layout="@layout/class_schedule" />              <include                 android:layout_width="match_parent"                 android:layout_height="wrap_content"                 layout="@layout/class_schedule" />                  <include                 android:layout_width="match_parent"                 android:layout_height="wrap_content"                 layout="@layout/class_schedule" />          </linearlayout>     </scrollview>  </linearlayout> 

class_schedule layout:

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     android:id="@+id/class_schedule"     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:orientation="vertical" >      <linearlayout         android:layout_width="match_parent"         android:layout_height="wrap_content" >           <textview             android:id="@+id/textview1"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:text="slo"             android:textappearance="?android:attr/textappearancelarge" />           <textview             android:id="@+id/textview2"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:text="(214)"             android:textappearance="?android:attr/textappearancemedium" />      </linearlayout>         <textview         android:id="@+id/textview3"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:text="10:00 - 10:45"         android:textappearance="?android:attr/textappearancemedium" />        <textview         android:id="@+id/textview4"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:text="Šušteršič"         android:textappearance="?android:attr/textappearancemedium" />  </linearlayout> 

any appreciated. thank you!


Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -