在android中滑动抽屉问题
问题描述:
我在活动中使用了listview和slidingdrawer。我的意图是打开滑动画笔并在点击列表项目时显示内容。滑动画笔内容将根据所选项目而改变。在android中滑动抽屉问题
UI布局如下所示。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/RelativeLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ListView
android:id="@+id/presentation_list"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
</ListView>
<SlidingDrawer
android:id="@+id/slidingDrawer1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:content="@+id/content"
android:handle="@+id/handle"
android:orientation="horizontal" >
<Button
android:id="@+id/handle"
android:layout_width="40dp"
android:layout_height="fill_parent"
android:background="@android:color/darker_gray" />
<LinearLayout
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/textView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Presentation's Images.. Please Flip"
android:textColor="@android:color/black"
android:textStyle="bold" />
<ImageView
android:id="@+id/content_imageview"
android:layout_width="match_parent"
android:layout_height="200dp"
android:background="@android:color/black"
android:layout_below="@id/presentation_list"
/>
</LinearLayout>
</SlidingDrawer>
我点击列表视图滑块打开了,当我在slidingdrawer的ImageView的也越来越点击我的列表视图中单击。控制进入列表视图项点击方法和图像变更
任何人都可以帮助我纠正这个问题吗?
答
添加android:clickable
属性您content
布局,将其设置为true
:
<LinearLayout
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:clickable="true" >
不幸的是,我无法解释为什么会发生。