Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android(本机java)-滑动抽屉-内容(Imageview和复选框)单击事件不触发_Android_Slidingdrawer - Fatal编程技术网

Android(本机java)-滑动抽屉-内容(Imageview和复选框)单击事件不触发

Android(本机java)-滑动抽屉-内容(Imageview和复选框)单击事件不触发,android,slidingdrawer,Android,Slidingdrawer,在其中一个项目中,我们有一个从底部滑动的面板。用户可以在其中选中复选框并单击面板内的图像。因此,我在相对布局中添加了一个滑动抽屉组件。顶部视图将包含,列表视图和底部,它将是一个滑动抽屉 我们有滑动部件的手柄和内容部件。在内容中,我添加了一个复选框和imageview。我想在用户单击其中任何一个时监听这些事件。我可以监听滑动抽屉事件,但不能监听其他两个单击事件 我是否错过了滑动抽屉内容部分中的事件监听功能。我尝试在布局xml中将clickable属性添加到true。但结果还是一样 我在谷歌上搜索,

在其中一个项目中,我们有一个从底部滑动的面板。用户可以在其中选中复选框并单击面板内的图像。因此,我在相对布局中添加了一个滑动抽屉组件。顶部视图将包含,列表视图和底部,它将是一个滑动抽屉

我们有滑动部件的手柄和内容部件。在内容中,我添加了一个复选框和imageview。我想在用户单击其中任何一个时监听这些事件。我可以监听滑动抽屉事件,但不能监听其他两个单击事件

我是否错过了滑动抽屉内容部分中的事件监听功能。我尝试在布局xml中将clickable属性添加到true。但结果还是一样

我在谷歌上搜索,但没有找到解决方案

如果我遗漏了什么,请告诉我

<SlidingDrawer android:id="@+id/slidingDrawer1" android:layout_width="match_parent" 
                android:layout_height="wrap_content" android:handle="@+id/handle" android:content="@+id/content"
                android:animateOnClick="true" android:padding="15dp" android:topOffset="250dp" android:allowSingleTap="true"
                >
                <LinearLayout android:layout_width="match_parent"
                    android:layout_height="wrap_content" >

                    <LinearLayout android:layout_width="match_parent" android:layout_height="50dp"
                        android:id="@+id/handle" android:background="@drawable/popbg" android:paddingLeft="20dp"
                        android:paddingTop="20dp" android:paddingRight="20dp">
                        <TextView android:layout_width="wrap_content" android:layout_height="wrap_content"
                                android:text="text1" android:textColor="#000000"
                                android:layout_weight="1"/>
                        <ImageView 
                            android:id="@+id/elrattSlidingIcon"
                            android:layout_width="wrap_content" android:layout_height="wrap_content"
                            android:src="@drawable/non_expand" android:layout_gravity="right"/>    
                    </LinearLayout>

                    <LinearLayout android:layout_width="match_parent"
                        android:layout_height="80dp"
                        android:gravity="center_horizontal" android:orientation="vertical"
                        android:id="@+id/content" android:paddingLeft="15dp" android:paddingRight="14dp"
                        android:clickable="true">
                        <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent"
                            android:gravity="top" android:padding="0dp"
                            android:clickable="true">
                            <LinearLayout android:layout_width="match_parent"
                                android:layout_height="match_parent" android:gravity="center_horizontal"
                                android:paddingTop="15dp" android:orientation="vertical"
                                android:background="@drawable/bg_elratt">
                                <ImageView android:id="@+id/elrattListBtmBtn"
                                    android:layout_width="match_parent" android:layout_height="wrap_content"
                                    android:src="@drawable/skickaintr_ov" android:clickable="true"/>
                                <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"
                                    android:orientation="horizontal" android:paddingLeft="50dp" android:paddingRight="50dp"
                                    android:paddingTop="10dp">
                                    <CheckBox android:id="@+id/usrOption" android:layout_width="0dp" android:layout_height="wrap_content"
                                        android:layout_weight="0.2" android:button="@drawable/checkbox_selector" android:tag="1"
                                        android:clickable="true"/>
                                    <TextView android:layout_width="0dp" android:layout_height="match_parent"
                                        android:text="test2" android:singleLine="false"
                                        android:layout_weight="0.8"/>
                                </LinearLayout>                                 
                            </LinearLayout>
                        </LinearLayout>
                    </LinearLayout>

                </LinearLayout>

            </SlidingDrawer>
提前感谢,, 当做
Srini

我找到了问题所在。不确定这是不是正确的。但这对我很有效

我删除了滑动抽屉组件后的直接线性布局。我已经添加了一个包装层。在这之后,我能够正常地聆听事件,没有任何其他变化。一切照常进行

谢谢

问候

斯利尼瓦桑