【发布时间】:2014-10-12 23:33:51
【问题描述】:
我正在使用来自 umanoAndroidSlidingUpPanel 的这个库,它工作正常,只是一个我无法解决的问题。 主要子项是工作正常的地图视图(静态主视图),第二个子项(滑动面板)是 webview 和 imageview 中的响应式 html 文件。 问题是当我向上滑动以滑动面板时,我无法在 webview 中滚动 html 文件。 该库声明我可以使单个视图可拖动,以便我可以滚动另一个视图,但我真的不知道该怎么做,我们将不胜感激。 这是我的 xml 文件
<com.sothree.slidinguppanel.SlidingUpPanelLayout
xmlns:sothree="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/sliding_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom"
sothree:panelHeight="50dp"
sothree:shadowHeight="4dp">
<fragment
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.google.android.gms.maps.MapFragment"/>
<LinearLayout
android:layout_width="match_parent"
android:id="@+id/llayout"
android:orientation="vertical"
android:layout_height="match_parent" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity ="center_horizontal"
android:src="@drawable/divider">
</ImageView>
<WebView
android:layout_width="match_parent"
android:id="@+id/desc"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:paddingBottom="7dp"/>
</LinearLayout>
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
【问题讨论】:
-
上面写着
By default, the whole [sliding up] panel will act as a drag region and will intercept clicks and drag events. You can restrict the drag area to a specific view by using the setDragView method or dragView attribute.,意思是你可以在上滑面板中定义一个视图,成为拖动视图,拦截点击和拖动事件的上滑面板。在这种情况下,ImageView。使用此解决方案,它不会干扰您的 Webview 的操作事件 -
或者,您可能需要将 Webview 放入 ScrollView stackoverflow.com/questions/6253444/android-webview-scrollable 或 stackoverflow.com/questions/13257990/…
标签: java android xml slidingdrawer