本帖最后由 glzlaohuai 于 2011-07-17 21:41:00 编辑

解决方案 »

  1.   

    你试着去处理一下handle的onclick。
      

  2.   

    应该是重写SlidingDrawer其中的处理Touch事件的方法,像onInterceptTouchEvent和dispatchTouchEvent,但是其事件处理机制不是很清楚。有谁能给详解一下吗?或者给个地址……
    我重写onInterceptTouchEvent返回false以后这个问题解决了,但是这个handle只能点击,不能拖动了。谁研究过Android组件之间的事件处理机制?给咱说说呗~~ 
      

  3.   

    http://topic.csdn.net/u/20110729/17/ce7ee9d0-c8de-4fc3-8a83-b311327f9566.html?seed=406911507&r=75415960#r_75415960 可以参考一下
      

  4.   

    你可以用button.getLocationOnScreen(int[]),int[]数组里,第一个是button的横坐标,第二个是纵坐标,然后去view.onTouchEvent(MotionEvent ev)里进行判断,如果ev.getX()和ev.getY()你的button的坐标区域就返回true,然后就应该不会响应SlidingDrawer的那个响事件了。onInterceptTouchEvent()其实顾名思义,是拦截touchEvent的,touch事件首先是调用的,然后才会是onTouchEvent(),如果onTouchEvent返回true就表示不把touch事件往其子控件传了,即到此结束了。在此说的比较简单,你可以百度一下,onInterceptTouchEvent() 和onTouchEvent()的区别,我就不多描述了
      

  5.   

    LZ 问一个问题。  本人也是在使用SlidingDrawer中因为一些需求出现技术上的问题。。本人给SlidingDraer添加了移动事件  也就是能够随意拖动,但是等拖动了之后 hander 好像没有焦点了还是怎么样,  点击的时候不能回去了, 求助下,  要怎么才能让SlidingDraer中的hander 重新获得焦点或者说 要怎样做才能让点击它的时候还想从前可以伸缩 在线等待。急 ,先谢谢了, 
      

  6.   

    <SlidingDrawer 
         android:id="@+id/slidingDrawer1"
         android:layout_width="fill_parent" 
         android:layout_height="wrap_content" 
         android:handle="@+id/handle" 
         android:layout_marginBottom="30px"
         android:content="@+id/content">
                    <Button 
            android:id="@+id/handle" 
            android:layout_height="15px" 
            android:layout_width="wrap_content" 
            android:background="@drawable/handle_bar_normal"
            ></Button>
           
           <ViewFlipper 
            android:id="@+id/content" 
            android:layout_height="fill_parent" 
            android:layout_width="wrap_content">
            <GridView 
            android:id="@+id/gridView1" 
            android:layout_width="fill_parent" 
            android:layout_height="wrap_content"
            android:horizontalSpacing="10px"
            android:verticalSpacing="10px"
            android:columnWidth="200px"
            >
            </GridView>
           </ViewFlipper>    </SlidingDrawer>
            <FrameLayout 
            android:id="@+id/handle" 
            android:layout_gravity="bottom"
            android:layout_height="30px"
            android:layout_width="fill_parent"
            android:background="@drawable/playlayout_bg"
            >
            <Button 
            android:layout_height="30px" 
            android:layout_width="wrap_content" 
            android:id="@+id/left"
            android:background="@drawable/handle_play_normal"
            ></Button>
             <TextView 
            android:layout_height="30px" 
            android:layout_width="wrap_content" 
            android:text="欢迎使用多米音乐"
            android:layout_gravity="center_horizontal"
            android:gravity="center_vertical"
            android:textSize="15px"
            android:id="@+id/centre"
            ></TextView>
            <Button 
            android:layout_height="30px" 
            android:layout_width="wrap_content" 
            android:id="@+id/right"
            android:background="@drawable/handle_menu_normal"
            android:layout_gravity="right"
            ></Button>
            </FrameLayout>
      

  7.   

    建议用RelativeLayout,用android:layout_alignBottom="ture" 
      

  8.   

    在你的SlidingDrawer加上android:allowSingleTap="false"
    就是<SlidingDrawer 
            android:allowSingleTap="false"然后再写你的点击事件即可