XML : background image on coordinator layout with nested scroll view

I have the xml shown below that is supposed to display a background image on the nested scroll view. however it only displays for android 5.0 going up but not for versions below lollipop. for the versions below 5.0 it only shows the circular image buttons without the background. any suggestions or ideas are highly appreciated and welcome

  <android.support.design.widget.CoordinatorLayout      xmlns:android="http://schemas.android.com/apk/res/android"      android:layout_height="match_parent"      android:layout_width="match_parent"      xmlns:app="http://schemas.android.com/apk/res-auto"      android:id="@+id/coordinator"      android:fitsSystemWindows="true">      <android.support.design.widget.AppBarLayout          android:id="@+id/appbar"          android:layout_height="192dp"          android:layout_width="match_parent"          android:fitsSystemWindows="true"          android:theme="@style/ThemeOverlay.AppCompat.Light">          <android.support.design.widget.CollapsingToolbarLayout              android:id="@+id/collapsing_toolbar"              android:layout_height="match_parent"              android:layout_width="match_parent"              android:fitsSystemWindows="true"              android:background="#000000"              app:contentScrim="?attr/colorPrimary"              app:expandedTitleMarginBottom="32dp"              app:expandedTitleMarginEnd="64dp"              app:expandedTitleMarginStart="48dp"              app:layout_scrollFlags="scroll|exitUntilCollapsed">              <ImageView                  android:id="@+id/header"                  android:layout_height="match_parent"                  android:layout_width="match_parent"                  android:background="@drawable/ndwlogo"                  android:fitsSystemWindows="true"                  android:scaleType="centerCrop"                  app:layout_collapseMode="parallax"/>              <android.support.v7.widget.Toolbar                  android:id="@+id/anim_toolbar"                  android:layout_width="match_parent"                  android:layout_height="?attr/actionBarSize"                  app:layout_collapseMode="pin"                  app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>          </android.support.design.widget.CollapsingToolbarLayout>      </android.support.design.widget.AppBarLayout>      <android.support.v4.widget.NestedScrollView          android:layout_width="match_parent"          android:layout_height="match_parent"          android:fillViewport="true"          app:layout_behavior="@string/appbar_scrolling_view_behavior">          <!-- Scrollable content goes inside-->          <!--this is the parent linear layout-->          <LinearLayout              android:layout_width="match_parent"              android:layout_height="match_parent"              android:orientation="vertical"              android:weightSum="9">              <LinearLayout                  android:layout_width="fill_parent"                  android:layout_marginTop="16dp"                  android:layout_height="0dp"                  android:orientation="horizontal"                  android:layout_weight="2"                  android:weightSum="2">                  <com.pkmmte.view.CircularImageView                      android:layout_width="0dp"                      android:id="@+id/agenda_btn"                      android:layout_marginLeft="56dp"                      android:layout_height="match_parent"                      android:layout_weight="1"                      android:src="@drawable/agenda"/>                  <com.pkmmte.view.CircularImageView                      android:layout_width="0dp"                      android:id="@+id/info_btn"                      android:layout_height="match_parent"                      android:layout_weight="1"                      android:src="@drawable/info" />              </LinearLayout>              <LinearLayout                  android:layout_width="fill_parent"                  android:layout_marginTop="?attr/actionBarSize"                  android:layout_height="0dp"                  android:orientation="horizontal"                  android:layout_gravity="center_horizontal"                  android:layout_weight="2"                  android:weightSum="2">                  <com.pkmmte.view.CircularImageView                      android:layout_width="0dp"                      android:layout_marginLeft="56dp"                      android:id="@+id/maps_btn"                      android:layout_height="match_parent"                      android:layout_weight="1"                      android:src="@drawable/maps"/>                  <com.pkmmte.view.CircularImageView                      android:layout_width="0dp"                      android:id="@+id/news_btn"                      android:layout_height="match_parent"                      android:layout_weight="1"                      android:src="@drawable/news" />              </LinearLayout>              <LinearLayout                  android:layout_width="fill_parent"                  android:layout_marginTop="?attr/actionBarSize"                  android:layout_height="0dp"                  android:orientation="horizontal"                  android:layout_gravity="center_horizontal"                  android:layout_weight="2"                  android:weightSum="2">                  <com.pkmmte.view.CircularImageView                      android:layout_width="0dp"                      android:layout_marginLeft="56dp"                      android:layout_height="match_parent"                      android:layout_weight="1"                      android:id="@+id/guide_btn"                      android:src="@drawable/ndw_guide"/>                  <com.pkmmte.view.CircularImageView                      android:layout_width="0dp"                      android:layout_height="match_parent"                      android:layout_weight="1"                      android:id="@+id/directory_btn"                      android:src="@drawable/directory" />              </LinearLayout>              <LinearLayout                  android:layout_width="fill_parent"                  android:layout_marginTop="?attr/actionBarSize"                  android:layout_height="0dp"                  android:orientation="horizontal"                  android:layout_gravity="center_horizontal"                  android:layout_weight="2"                  android:weightSum="2">                  <com.pkmmte.view.CircularImageView                      android:layout_width="0dp"                      android:layout_marginLeft="56dp"                      android:layout_height="match_parent"                      android:layout_weight="1"                      android:id="@+id/social_btn"                      android:src="@drawable/socialmedia"/>                  <com.pkmmte.view.CircularImageView                      android:layout_width="0dp"                      android:layout_height="match_parent"                      android:layout_weight="1"                      android:id="@+id/partners_btn"                      android:src="@drawable/partners" />              </LinearLayout>              <LinearLayout                  android:layout_width="wrap_content"                  android:layout_height="wrap_content"                  android:paddingLeft="32dp"                  android:layout_weight="1">                  <TextView                      android:id="@+id/showtimer"                      android:layout_width="match_parent"                      android:layout_height="match_parent"                      android:text="@string/showtimer" />              </LinearLayout>              <LinearLayout                  android:layout_width="fill_parent"                  android:layout_marginTop="20dp"                  android:layout_height="0dp"                  android:orientation="horizontal"                  android:layout_gravity="center_horizontal"                  android:layout_weight="2"                  android:weightSum="4">                    <TextView                      android:layout_height="match_parent"                      android:layout_marginLeft="32dp"                      android:id="@+id/timerday"                      android:text="@string/countdowndefault"                      android:layout_width="0dp"                      android:textSize="30dp"                      android:layout_weight="1"/>                  <TextView                      android:layout_width="0dp"                      android:layout_height="match_parent"                      android:layout_weight="1"                      android:textSize="30dp"                      android:text="@string/countdowndefault"                      android:id="@+id/timerhour" />                  <TextView                      android:layout_width="0dp"                      android:layout_height="match_parent"                      android:layout_weight="1"                      android:textSize="30dp"                      android:text="@string/countdowndefault"                      android:id="@+id/timermins"/>                  <TextView                      android:layout_width="0dp"                      android:layout_height="match_parent"                      android:layout_weight="1"                      android:textSize="30dp"                      android:text="@string/countdowndefault"                      android:id="@+id/timersec" />              </LinearLayout>          </LinearLayout>      </android.support.v4.widget.NestedScrollView>  </android.support.design.widget.CoordinatorLayout>    

No comments:

Post a Comment