NestedScrollView上的行为

时间:2018-04-02 14:43:36

标签: android nestedscrollview

我正在使用这个库'com.mahc.custombottomsheetbehavior:googlemaps-like:0.9.1'来创建BottomSheet,除了layout_behavior之外,每件事都没问题,当我添加它时,会出现渲染问题

<android.support.v4.widget.NestedScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/ma_bottom_sheet"
    android:background="@android:color/white"
    android:layout_gravity="bottom"
    app:behavior_hideable="true"
    app:behavior_peekHeight="100dp"
    app:layout_behavior="@string/BottomSheetBehaviorGoogleMapsLike"
   >

    <include
        layout="@layout/bottom_sheet_content"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true"/>

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

错误日志:

java.lang.ClassCastException: com.android.layoutlib.bridge.android.BridgeContext cannot be cast to android.app.Activity
at com.mahc.custombottomsheetbehavior.ScrollingAppBarLayoutBehavior.setStatusBarBackgroundVisible(ScrollingAppBarLayoutBehavior.java:177)
at com.mahc.custombottomsheetbehavior.ScrollingAppBarLayoutBehavior.init(ScrollingAppBarLayoutBehavior.java:109)
at com.mahc.custombottomsheetbehavior.ScrollingAppBarLayoutBehavior.onDependentViewChanged(ScrollingAppBarLayoutBehavior.java:78)
at android.support.design.widget.CoordinatorLayout.onChildViewsChanged(CoordinatorLayout.java:1335)
at android.support.design.widget.CoordinatorLayout$OnPreDrawListener.onPreDraw(CoordinatorLayout.java:1930)
at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:977)
at android.view.AttachInfo_Accessor.dispatchOnPreDraw(AttachInfo_Accessor.java:46)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.renderAndBuildResult(RenderSessionImpl.java:402)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.renderAndBuildResult(RenderSessionImpl.java:541)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.render(RenderSessionImpl.java:424)
at com.android.layoutlib.bridge.BridgeRenderSession.render(BridgeRenderSession.java:108)
at com.android.ide.common.rendering.api.RenderSession.render(RenderSession.java:154)
at com.android.ide.common.rendering.api.RenderSession.render(RenderSession.java:136)
at com.android.tools.idea.rendering.RenderTask.lambda$renderInner$5(RenderTask.java:760)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

0 个答案:

没有答案