小编R K*_*mar的帖子

ConstraintLayout通知徽章

关于ConstraintLayout通知徽章

我已经使用ConstraintLayout进行通知,如下所示.

在这里我使用了ImageButton和textview 在此输入图像描述

出局:

在此输入图像描述

这里我使用了Button和textview

在此输入图像描述

输出:

在此输入图像描述

使用了imageview的按钮然后看起来像这样.可以帮助我在constraintLayout中解决这个问题.

例如: 在此输入图像描述

当我尝试使用按钮时,它会像这样显示.

如果您正在使用FrameLayout或RelativeLayout显示徽章,我必须知道的另一个新功能是对Button,ImageView或ImageButtom都正常工作.

但是长按或点击按钮通知徽章会回来,在Imageview和imagebutton中工作正常.

android android-layout android-constraintlayout

9
推荐指数
1
解决办法
998
查看次数

Html5在Android中拖放

我尝试使用HTML5在Android浏览器中实现简单的拖放操作.当我尝试拖动对象时,只有屏幕滚动,我无法拖动任何内容.有没有办法做到这一点?

HTML在这里:

 For drag:   

<div id="an-obj-12" draggable="true" ondragstart="drag(event)" dropzone="copy">42a</div>
<div id="an-obj-13"  draggable="true" ondragstart="drag(event)" dropzone="copy">4a</div>
<div id="an-obj-14"  draggable="true" ondragstart="drag(event)" dropzone="copy">14</div>

For drop:

<div id="an-obj-7" ondrop="drop(event,'12a^2')" ondragover="allowDrop(event)"></div>
<div id="an-obj-8" ondrop="drop(event,'42a')" ondragover="allowDrop(event)"></div>
<div id="an-obj-9" ondrop="drop(event,'4a')" ondragover="allowDrop(event)"></div>
Run Code Online (Sandbox Code Playgroud)

html5 android

7
推荐指数
1
解决办法
2720
查看次数

7
推荐指数
1
解决办法
1566
查看次数

finishActivity()可能的用例是什么?

正如我已经知道的那样Finish() and FinishActivity().即

finish() 在您的活动完成后调用此选项并应关闭.

finishActivity() 用于完成您之前开始的另一项活动 startActivityForResult(Intent, int);

我想通过示例代码简要介绍一下这个问题.了解它是如何工作的.

android android-intent android-layout android-fragments

4
推荐指数
1
解决办法
6765
查看次数