android - ScrollView inside ScrollView not work -


i tried search tutorial scrollview inside scrollview, , found many no 1 work me. layout bellow. second scrollview (id = scroll_view_carousel) not work. please me.

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:app="http://schemas.android.com/apk/res-auto"     xmlns:tools="http://schemas.android.com/tools"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:fitssystemwindows="true"     android:orientation="vertical"     tools:context="com.rytmus.app.activities.detailsactivity">      <android.support.design.widget.appbarlayout         android:id="@+id/appbar"         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:background="@color/white"         android:theme="@style/apptheme.appbaroverlay">          <android.support.v7.widget.toolbar             android:id="@+id/toolbar"             android:layout_width="match_parent"             android:layout_height="?attr/actionbarsize"             android:background="@color/white"             android:theme="@style/toolbar"             app:collapseicon="@drawable/ic_arrow_back_white_24dp"             app:layout_scrollflags="scroll|enteralways"             app:title="rytmus"             app:titletextcolor="@color/colorprimary">          </android.support.v7.widget.toolbar>      </android.support.design.widget.appbarlayout>      <scrollview         android:id="@+id/scroll_view"         android:layout_width="match_parent"         android:layout_height="match_parent">          <relativelayout             android:layout_width="match_parent"             android:layout_height="match_parent"             android:layout_margin="0dp">              <imageview                 android:id="@+id/big_logo"                 android:layout_width="match_parent"                 android:layout_height="160dp"                 android:scaletype="centercrop" />              <scrollview                 android:id="@+id/scroll_view_carousel"                 android:layout_width="match_parent"                 android:layout_height="75dp"                 android:layout_below="@id/big_logo"                 android:background="@color/colorblack">                  <linearlayout                     android:layout_width="match_parent"                     android:layout_height="60dp"                     android:layout_margintop="5dp"                     android:orientation="horizontal">                      <imageview                         android:layout_width="60dp"                         android:layout_height="60dp"                         android:layout_marginright="5dp"                         android:scaletype="centercrop"                         android:src="@drawable/background_rytmus_disco" />                      <imageview                         android:layout_width="60dp"                         android:layout_height="60dp"                         android:layout_marginright="5dp"                         android:scaletype="centercrop"                         android:src="@drawable/background_rytmus_disco" />                      <imageview                         android:layout_width="60dp"                         android:layout_height="60dp"                         android:layout_marginright="5dp"                         android:scaletype="centercrop"                         android:src="@drawable/ic_arrow_back_white_24dp" />                      <imageview                         android:layout_width="60dp"                         android:layout_height="60dp"                         android:layout_marginright="5dp"                         android:scaletype="centercrop"                         android:src="@drawable/background_rytmus_disco" />                      <imageview                         android:layout_width="60dp"                         android:layout_height="60dp"                         android:layout_marginright="5dp"                         android:scaletype="centercrop"                         android:src="@drawable/com_facebook_button_like_background" />                      <imageview                         android:layout_width="60dp"                         android:layout_height="60dp"                         android:layout_marginright="5dp"                         android:scaletype="centercrop"                         android:src="@drawable/background_rytmus_disco" />                      <imageview                         android:layout_width="60dp"                         android:layout_height="60dp"                         android:layout_marginright="5dp"                         android:scaletype="centercrop"                         android:src="@drawable/background_rytmus_disco" />                      <imageview                         android:layout_width="60dp"                         android:layout_height="60dp"                         android:layout_marginright="5dp"                         android:scaletype="centercrop"                         android:src="@drawable/background_rytmus_disco" />                      <imageview                         android:layout_width="60dp"                         android:layout_height="60dp"                         android:layout_marginright="5dp"                         android:scaletype="centercrop"                         android:src="@drawable/background_rytmus_disco" />                      <imageview                         android:layout_width="60dp"                         android:layout_height="60dp"                         android:layout_marginright="5dp"                         android:scaletype="centercrop"                         android:src="@drawable/background_rytmus_disco" />                  </linearlayout>              </scrollview>              <linearlayout                 android:id="@+id/four_buttons"                 android:layout_width="match_parent"                 android:layout_height="46dp"                 android:layout_below="@id/scroll_view_carousel"                 android:background="@color/coloraccent"                 android:orientation="horizontal">                  <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"                     android:id="@+id/tabfirstsbuttonslinearlayout"                     android:layout_width="fill_parent"                     android:layout_height="fill_parent"                     android:layout_weight="1"                     android:orientation="vertical">                   </linearlayout>                  <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"                     android:layout_width="100dp"                     android:layout_height="fill_parent"                     android:orientation="vertical" />                  <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"                     android:id="@+id/tabsecondsbuttonslinearlayout"                     android:layout_width="fill_parent"                     android:layout_height="fill_parent"                     android:layout_centerhorizontal="true"                     android:layout_weight="1"                     android:orientation="vertical">                   </linearlayout>              </linearlayout>              <linearlayout                 android:layout_width="match_parent"                 android:layout_height="match_parent"                 android:orientation="vertical">              </linearlayout>              <linearlayout                 android:id="@+id/tabs_disco_details"                 android:layout_width="match_parent"                 android:layout_height="46dp"                 android:layout_below="@id/four_buttons"                 android:background="@color/colorprimary"                 android:orientation="horizontal">                  <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"                     android:id="@+id/tabdescriptionlinearlayout"                     android:layout_width="fill_parent"                     android:layout_height="fill_parent"                     android:layout_weight="1"                     android:orientation="vertical">                      <textview xmlns:android="http://schemas.android.com/apk/res/android"                         android:id="@+id/tabdescription"                         android:layout_width="wrap_content"                         android:layout_height="match_parent"                         android:layout_gravity="center"                         android:layout_margin="4dp"                         android:gravity="center"                         android:paddingleft="10dp"                         android:text="descripciĆ³n"                         android:textcolor="@color/white"                         android:textsize="13sp" />                 </linearlayout>                  <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"                     android:layout_width="90dp"                     android:layout_height="fill_parent"                     android:orientation="vertical" />                  <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"                     android:id="@+id/tabvalorationlinearlayout"                     android:layout_width="fill_parent"                     android:layout_height="fill_parent"                     android:layout_centerhorizontal="true"                     android:layout_weight="1"                     android:orientation="vertical">                      <textview xmlns:android="http://schemas.android.com/apk/res/android"                         android:id="@+id/tabvaloration"                         android:layout_width="wrap_content"                         android:layout_height="match_parent"                         android:layout_gravity="center"                         android:layout_margin="4dp"                         android:gravity="center"                         android:paddingleft="10dp"                         android:text="valoraciones"                         android:textcolor="@color/white"                         android:textsize="13sp" />                 </linearlayout>              </linearlayout>              <linearlayout                 android:id="@+id/container_fragment"                 android:layout_width="match_parent"                 android:layout_height="match_parent"                 android:layout_below="@id/tabs_disco_details"                 android:orientation="vertical" />              <linearlayout                 android:layout_width="101dp"                 android:layout_height="101dp"                 android:layout_below="@id/scroll_view_carousel"                 android:layout_centerhorizontal="true"                 android:background="@drawable/border"                 android:translationy="-5dp">                  <imageview                     android:id="@+id/imagen_logo"                     android:layout_width="100dp"                     android:layout_height="100dp"                     android:layout_centerhorizontal="true"                     android:src="@drawable/background_rytmus_disco" />              </linearlayout>          </relativelayout>      </scrollview> </linearlayout> 

solution

i change second scrollview 1 horizontalscrollview , work!!!

very bad programming practice. can't embed scrollview inside scrollview.

in general listview inside scrollview not working because listview has own scrolling functionality , again embedding scrollview class thats why create jerk.

same in how should integrate scrollview inside scrollview? think logically how should possible? confuse scrollview getting triggered?


Comments