java - 使用叠加层时如何使按钮可点击
问题描述
我希望覆盖下的设置按钮能够只单击一个按钮。我尝试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++;
}
.
.
.
}
}
我希望当工具提示出现在 Button 上时,Button 可以通过覆盖单击不是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 中的事件上使用片段按钮
id应该怎么做?(对不起英语)
解决方案
好的,我现在使用FancyShowCaseview库。它的工作!覆盖教程用户指南,第一次,我不想使用库,因为想练习我的 android 但我不知道。谢谢你,对不起英语(我会练习的。)
推荐阅读
- excel - Excel公式查找特定数字
- python - 将 vici 套接字连接到特定的网络命名空间
- javascript - VS Code问题:当我保存时,行和空格会自动添加并破坏代码
- php - 角色 codeigniter 的语句
- javascript - 用时刻反应js日期格式
- html - 有没有办法使这种输入数字类型起作用?[HTML5]
- python - 我正在尝试使用 Python 中的 BeautifulSoup 从网站获取表格。但是,当我打印表格时,它没有显示
- python - 在几个熊猫数据框优化上计算列
- c# - 将 lambda 表达式移动到实体框架中的静态扩展方法
- python - 如何在每次读取时更新配置?