2

我使用 anObservableScrollView作为父布局,并且可以根据我滚动父级的方式滚动内容(类似于 Google I/O 2014 应用程序)。一切都按预期工作,直到我添加Tabhost with ViewpagerObservableScrollView. 现在我可以滚动 Viewpager 的内容,但不能滚动 Parent Scrollview。我认为问题在于焦点。我怎样才能使父ObservableScrollView级与 Viewpager 和 Tabhost 一起在里面滚动?

谢谢。

<com.rfit.views.ObservableScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scroll_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/WhiteSmoke"
android:fillViewport="true"
android:overScrollMode="never">

<FrameLayout
    android:id="@+id/scroll_view_child"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:clipChildren="false">

    <!-- Background photo -->
    <FrameLayout
        android:id="@+id/session_photo_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:foreground="@drawable/photo_banner_scrim">

        <ImageView
            android:id="@+id/session_photo"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@color/LightGrey"


            android:scaleType="centerCrop" />
    </FrameLayout>

    <LinearLayout
        android:id="@+id/details_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/WhiteSmoke"
        android:clipToPadding="false"
        android:orientation="vertical"
        android:paddingLeft="@dimen/keyline_1"

        android:paddingRight="@dimen/keyline_1"
        android:paddingTop="16dp">









            <TabHost
                android:id="@android:id/tabhost"
                android:layout_width="match_parent"


                android:layout_height="wrap_content" >

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"

                    android:orientation="vertical" >

                    <TabWidget
                        android:id="@android:id/tabs"
                        android:orientation="horizontal"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_weight="0" />

                    <FrameLayout
                        android:id="@android:id/tabcontent"
                        android:layout_width="0dp"
                        android:layout_height="0dp"
                        android:layout_weight="0">


                    </FrameLayout>

                    <android.support.v4.view.ViewPager

                        android:id="@+id/viewpager"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_gravity="bottom" />







                </LinearLayout>
            </TabHost>







    </LinearLayout>

    <!-- Title/subtitle bar (floating; position determined at run time as the content view scrolls) -->
    <FrameLayout
        android:id="@+id/header_session"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:clipChildren="false"
        android:clipToPadding="false">

        <!-- height assigned dynamically -->
        <View
            android:id="@+id/header_background"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:background="@color/revofit_eat" />




        <LinearLayout
            android:id="@+id/header_session_contents"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@color/revofit_eat"
            android:orientation="vertical"
            android:paddingBottom="16dp"
            android:paddingLeft="@dimen/keyline_2_session_detail"
            android:paddingRight="@dimen/keyline_1"
            android:paddingTop="16dp">

            <!-- Session title -->
            <TextView
                android:id="@+id/session_title"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="start"
                android:layout_marginBottom="0dp"
                android:ellipsize="end"
                android:fontFamily="@string/font_fontFamily_medium"
                android:lineSpacingMultiplier="1.1"
                android:maxLines="2"

                android:text="Bacon ipsum dolor sit amet chicken beef ribs kielbasa, tail bacon porchetta ground round voluptate sed aute shank meatball. Swine in andouille, ex esse duis fatback laboris ullamco frankfurter landjaeger. Beef ribs excepteur filet mignon meatloaf, jerky sausage esse beef meatball strip steak sint sunt et turducken bresaola. "
                android:textColor="@color/White"
                android:textSize="@dimen/text_size_large" />

            <!-- Session subtitle -->
            <TextView
                android:id="@+id/session_subtitle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="start"
                android:ellipsize="end"
                android:maxLines="2"
                android:text="Dolor occaecat hamburger"
                android:textColor="@color/wallet_hint_foreground_holo_dark"
                android:textSize="16sp" />







        </LinearLayout>






        <View
            android:id="@+id/header_shadow"
            android:layout_width="match_parent"
            android:layout_height="6dp"

            android:layout_gravity="bottom"
            android:layout_marginBottom="-6dp"
            android:background="@drawable/bottom_shadow" />


    </FrameLayout>

    <!-- FAB -->
    <include layout="@layout/include_add_schedule_fab" />


</FrameLayout></com.rfit.views.ObservableScrollView>

截屏

4

0 回答 0