簡體   English   中英

使用疊加層時如何使按鈕可單擊

[英]How to make the button clickable when using overlay

我希望疊加下的設置按鈕只能單擊一個按鈕。 我在疊加布局中嘗試setClickable 如果不在疊加布局中,按鈕不能單擊,但如果我想要canclick,我只想按下按鈕。 問題: 我想知道以哪種方式我可以做一個教程,用戶將按教程使用該應用程序

打開是APP

在此輸入圖像描述

當按教程

在此輸入圖像描述

我想按鈕可以在出現工具提示時單擊

在此輸入圖像描述

我按下按鈕是

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中使用Event上的Fragment Button

id該怎么辦? (對不起英文)

好了,我使用FancyShowCaseview庫。它的工作! 覆蓋教程用戶指南,第一次,我不想使用庫因為想要實踐我的機器人,但我沒有任何想法。 謝謝你,對不起英語(我會很抱歉。)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM