小编Tho*_*ric的帖子

ScrollView ViewPager内部不起作用

我有一个活动ViewPager,并且有选项卡式的子级。具有回收者视图的孩子可以滚动。虽然当我用滚动视图创建一个简单的片段时它不起作用。这是主要的活动片段-

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 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:id="@+id/tabbed_main"
android:background="#FFFFFF"
android:screenOrientation="portrait"
xmlns:fab="http://schemas.android.com/apk/res-auto">
<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:isScrollContainer="true"
        android:scrollbars="none">
        <android.support.v4.view.ViewPager
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:id="@+id/vp_horizontal_ntb"
            android:gravity="center"
            android:paddingLeft="0dp"
            android:paddingRight="0dp"
            android:isScrollContainer="true"
            app:layout_behavior="@string/appbar_scrolling_view_behavior" />
    </LinearLayout>
</RelativeLayout>

<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom"
    android:fitsSystemWindows="true">
<com.gigamole.navigationtabbar.ntb.NavigationTabBar
    android:layout_width="match_parent"
    android:layout_height="60dp"
    android:id="@+id/ntb_horizontal"
    app:ntb_badge_size="12sp"
    app:ntb_badge_bg_color="#ffff0000"
    app:ntb_badge_gravity="top"
    app:ntb_badge_position="right"
    app:ntb_badge_title_color="#ffffffff"
    app:ntb_badge_use_typeface="true"
    app:ntb_badged="true"
    app:ntb_animation_duration="400" />
</LinearLayout>


<com.getbase.floatingactionbutton.FloatingActionsMenu
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|end"
    android:id="@+id/create_new_button"
    android:layout_marginBottom="60dp"
    android:layout_marginRight="16dp"
    android:layout_marginEnd="16dp"
    fab:fab_addButtonColorNormal="@color/white_add"
    fab:fab_addButtonColorPressed="@color/white_pressed"
    fab:fab_addButtonPlusIconColor="@color/half_black"
    fab:fab_labelStyle="@style/menu_labels_style">
    <com.getbase.floatingactionbutton.FloatingActionButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/action_create_post"
        fab:fab_colorNormal="@color/white_add"
        fab:fab_title="Create New Post"
        fab:fab_icon="@drawable/ic_create_black_24dp"
        fab:fab_colorPressed="@color/white_pressed"/>
    <com.getbase.floatingactionbutton.FloatingActionButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/action_create_new_message"
        fab:fab_colorNormal="@color/white_add" …
Run Code Online (Sandbox Code Playgroud)

android scrollview android-fragments android-viewpager

3
推荐指数
1
解决办法
6622
查看次数