【问题标题】:Having trouble with the umano android slidinguppanel 2 views as sliding childumano android slipuppanel 2 视图作为滑动子项时遇到问题
【发布时间】: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 的操作事件

标签: java android xml slidingdrawer


【解决方案1】:

我修复了它我只需要调用库方法来设置dragview,并且只将imageview设置为可拖动的,这样webview就可以正常滚动了, 以下是我的做法:

     ImageView image=(ImageView)findViewById(R.id.divideri); //Layout to slide  
    SlidingUpPanelLayout layout = (SlidingUpPanelLayout)
    findViewById(R.id.sliding_layout); 


    layout.setDragView(image); 

反复无常...

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多