1

我有一个webview里面NestedScrollViewCoordinatorLayout问题是在 android 5 中没有显示全部内容。我使用这个解决方案这个解决方案,但它不起作用。我的代码有什么问题?

XML:

<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent">

<android.support.design.widget.AppBarLayout
    android:id="@+id/appbar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:fitsSystemWindows="true"
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

    <android.support.design.widget.CollapsingToolbarLayout
        android:id="@+id/collapsing_toolbar"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true"
        app:contentScrim="?attr/colorPrimary"
        app:expandedTitleMarginEnd="64dp"
        app:expandedTitleMarginStart="48dp"
        app:layout_scrollFlags="scroll|exitUntilCollapsed">

        <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="fill_parent"
            android:layout_height="match_parent">

            <com.android.volley.toolbox.NetworkImageView
                android:id="@+id/img_circleThumbnail1"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:adjustViewBounds="true"
                android:scaleType="fitCenter"
                android:visibility="invisible"
                app:layout_collapseMode="parallax">

            </com.android.volley.toolbox.NetworkImageView>


            <ir.whc.news.views.CustomFontTextView
                android:id="@+id/tv_title_news"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="bottom"
                android:gravity="center"
                android:shadowColor="#000"
                android:shadowDx="1"
                android:shadowDy="3"
                android:shadowRadius="5"
                android:text="title"
                android:textSize="20sp"
                android:textStyle="bold"
                app:fontName="@string/byaken" />
        </FrameLayout>

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="@dimen/abc_action_bar_default_height_material"
            app:layout_collapseMode="pin"
            app:popupTheme="@style/AppTheme.PopupOverlay"></android.support.v7.widget.Toolbar>
    </android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>

<android.support.v4.widget.SwipeRefreshLayout
    android:id="@+id/swipe_refresh_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior">


    <android.support.v4.widget.NestedScrollView
        android:layout_gravity="fill_vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="ir.whc.news.views.FixedScrollingViewBehavior">

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <LinearLayout

                android:id="@+id/content_layput"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical"
                android:visibility="invisible">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal">


                    <include layout="@layout/custom_txt_date"></include>

                    <View
                        android:layout_width="0dp"
                        android:layout_height="0dp"
                        android:layout_weight="1" />

                    <ir.whc.news.views.CustomFontTextView
                        android:id="@+id/tv_cnt_eye"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:paddingLeft="6dp"
                        android:textAppearance="?android:attr/textAppearanceSmall"
                        android:textColor="@color/textColorPrimary2"
                        android:textSize="11sp"
                        app:fontName="@string/byaken" />

                    <com.beardedhen.androidbootstrap.AwesomeTextView
                        android:id="@+id/fontAwesomeText1"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="16dp"
                        android:layout_marginRight="16dp"
                        android:textColor="#FFF"
                        app:fontAwesomeIcon="fa_eye" />


                </LinearLayout>

                <View
                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:background="@android:color/darker_gray" />

                <ir.whc.news.views.CustomFontTextView
                    android:id="@+id/tv_sum_news"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center"
                    android:lineSpacingExtra="15dp"
                    android:paddingBottom="20dp"
                    android:paddingLeft="5dp"
                    android:paddingRight="5dp"
                    android:textAppearance="?android:attr/textAppearanceSmall"
                    app:fontName="@string/byaken" />


                <FrameLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:minHeight="500dp">

                    <WebView
                        android:id="@+id/webView1"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:background="@android:color/transparent"
                        android:clickable="true"
                        android:scrollbars="vertical"
                        android:textAlignment="center"
                        android:textDirection="rtl" />
                </FrameLayout>

            </LinearLayout>

            <LinearLayout
                android:id="@+id/content_problem_layout"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:visibility="invisible">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:layout_margin="20dp"
                    android:gravity="center"
                    android:text="@string/connection_problem"
                    android:textColor="@color/blue_1" />
            </LinearLayout>
        </FrameLayout>

    </android.support.v4.widget.NestedScrollView>

</android.support.v4.widget.SwipeRefreshLayout>

<android.support.design.widget.FloatingActionButton
    android:id="@+id/fab"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|right"
    android:layout_marginBottom="20dp"
    android:layout_marginRight="20dp"
    android:src="@drawable/ic_bookmark_white_normal"
    app:fabSize="normal" />

这是我里面的不完整文字webview在此处输入图像描述

4

1 回答 1

0

如果我说得对,我认为你应该使用 android:fitsSystemWindows=“true”</p>

或者如果不能,您可以显示您的 webview 渲染的不完整内容吗???

于 2016-06-18T20:24:20.180 回答