可以长按按钮并在Android中更改其文本 [英] Possbile to long press button and change its text in Android
本文介绍了可以长按按钮并在Android中更改其文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我能够长按一个按钮并使用5.0及更高版本上的剪贴板更改其文本. 长按会出现光标,可以打开剪贴板.
I am able to long press a button and change its text using clipboard on 5.0 and above. On long pressing cursor appears and clipboard can be opened.
除了禁用按钮以外,还有其他解决方案吗?我尝试将onLongClickListener设置为null.这是我的按钮:
Any solution other that disabling the button ? I have tried setting onLongClickListener as null.Here is my button :
<Button
android:id="@+id/btn1"
style="@style/ButtonRegular"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_margin="@dimen/md_8dp_margin"
android:gravity="center"
android:minWidth="@dimen/width_280dp"
android:padding="12dp"
android:text="abc"
android:textColor="@color/white" />
在我的应用中,当您长按剪贴板时可以打开以更改按钮文本
In my app when you longpress clipboard can be opened to chnage button text
推荐答案
这是我的错误.我在按钮样式的行下方添加了引起问题的
It was my mistake. I was adding below line in button style which caused issue
<item name="android:inputType">textCapWords</item>
这篇关于可以长按按钮并在Android中更改其文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文