Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/229.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 当我不';在安卓系统中,你不能按这个按钮吗?_Android_Android Widget - Fatal编程技术网

Android 当我不';在安卓系统中,你不能按这个按钮吗?

Android 当我不';在安卓系统中,你不能按这个按钮吗?,android,android-widget,Android,Android Widget,再见 我有一个包含自定义项目的图库: 项目示例: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:gravity="center_horizontal" android:layout_width="253dp" android:layou

再见

我有一个包含自定义项目的图库:

项目示例:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:orientation="vertical"
          android:gravity="center_horizontal"
          android:layout_width="253dp"
          android:layout_height="500dp"
          android:focusable="false">
<ImageButton
    android:id="@+id/play"
    style="@style/somestyle" />

所有项目都显示画廊罚款,但当我试图滚动的画廊按钮内的项目是按滚动也按下。如果我按了物品里面的按钮(我没有按的)就好了


如何关闭它?

在项目渲染器内部使用时,您应该为
ImageButton
设置更多参数,以使其响应单击(点击),但按预期工作,而不复制父级状态:

<ImageButton
    android:id="@+id/play"
    style="@style/somestyle"
    android:focusable="false" 
    android:focusableInTouchMode="false" />


这可以集成到您的
somestyle
定义中

将此添加到图像中的ur xml按钮android:clickable=“false”;我需要项目内部的可单击按钮,但只有我要按它(现在我按布局区域(!不是按钮!)按钮被按下)嗯,我想我知道问题在哪里,但我不知道如何解决它。ImageButton具有状态_pressed=“true”和默认设置。当我按下布局按钮时,认为我按下了布局按钮,并显示了按下状态。我试图将state_focused=true添加到此项,但仍然无法工作=/