java - 如何在使用覆盖时使按钮可点击

标签 java android

我希望覆盖层下的设置按钮能够仅单击一个按钮。我在叠加布局中尝试 setClickable 。如果不在覆盖布局中,则按钮无法单击,但如果我想要可以单击,我只想按按钮。 问题:我想知道如何制作用户将按教程使用该应用程序的教程

打开的是APP

enter image description here

按时教程

enter image description here

我希望出现工具提示时可以单击按钮

enter image description here

我设置按下按钮是

public void onClick(View v) {
if (v.getId() == R.id.button8) {
           .
           .
            //This is Set Constraintlayout id in isoverlay
            overlay.setVisibility(View.VISIBLE);
            overlay.setClickable(true);
     }
if (v.getId() == R.id.bisoverlay) {

if (c == 0) {
      t1 = new Tooltip.Builder(b1)
         .setText("FragButton")
         .setGravity(Gravity.BOTTOM)
         .show();
         c++;
          }
   .
   .
   .
     }

}

我希望当按钮上出现工具提示时,按钮可以通过覆盖点击而不是GONE 此 XML 代码:

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout ...>

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <android.support.constraint.ConstraintLayout
            android:id="@+id/moverlay"
            android:layout_width="match_parent"
            android:layout_height="match_parent">
            <!--android:clickable="true"-->

            <fragment
                android:id="@+id/fragment1"
                android:name="com.example.test.BlankFragment"
                .../>

            <Button
                android:id="@+id/button8"
                ... />

            <Button
                android:id="@+id/button9"
                ... />

        </android.support.constraint.ConstraintLayout>

        <android.support.constraint.ConstraintLayout
            android:id="@+id/isOverlay"
            ...

            <Button
               ...
        </android.support.constraint.ConstraintLayout>

    </FrameLayout>

</android.support.constraint.ConstraintLayout>

我在 mainActivity 的事件上使用 Fragment Button

id 应该做什么? (对不起英语)

最佳答案

现在好了,我使用FancyShowCaseview库。它工作了!覆盖教程用户指南,第一次,我不想使用库,因为想练习我的 android 但我没有任何想法。谢谢你,抱歉英语不好(我会练习的。)

关于java - 如何在使用覆盖时使按钮可点击,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56678093/

相关文章:

android - CoordinatorLayout 状态栏填充在 fragment 事务期间消失

android - 在 Android/Kotlin 上使用 GSON 解析空值

java - 没有 RPC 代理的 GXT 分页

android - 如何从包含多行的列表中创建上下文菜单

android - 限制 parent 获得焦点点击其 child 之一

android - 如何解决 "Can' t 更新应用程序(错误代码 : 901)"error?

java - 通过aspectj拦截拦截函数内部的所有函数调用

java - 图像IO异常

java - Tomcat jdbc 池不工作

java - 从列表中提取 String[] 元素