我希望覆盖层下的设置按钮能够仅单击一个按钮。我在叠加布局中尝试 setClickable
。如果不在覆盖布局中,则按钮无法单击,但如果我想要可以单击,我只想按按钮。
问题:我想知道如何制作用户将按教程使用该应用程序的教程
打开的是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 的事件上使用 Fragment Button
id 应该做什么? (对不起英语)
最佳答案
现在好了,我使用FancyShowCaseview库。它工作了!覆盖教程用户指南,第一次,我不想使用库,因为想练习我的 android 但我没有任何想法。谢谢你,抱歉英语不好(我会练习的。)
关于java - 如何在使用覆盖时使按钮可点击,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56678093/