Java 如何在Android应用程序中实现触摸效果
你好, 我目前正在开发一个类似WhatsApp的聊天应用程序,我有一个问题,我不知道如何解决。 下面是我的聊天屏幕工具栏的屏幕截图。 问题:每当用户单击后退图标和联系人姓名时,都没有触摸事件/标志 我想要这样的东西,Java 如何在Android应用程序中实现触摸效果,java,android,Java,Android,你好, 我目前正在开发一个类似WhatsApp的聊天应用程序,我有一个问题,我不知道如何解决。 下面是我的聊天屏幕工具栏的屏幕截图。 问题:每当用户单击后退图标和联系人姓名时,都没有触摸事件/标志 我想要这样的东西, 这里有一个简单的android涟漪效应,但它只适用于API21及以上版本 在drawable-v21 <?xml version="1.0" encoding="utf-8"?> <ripple xmlns:android=
这里有一个简单的android涟漪效应,但它只适用于
API21
及以上版本
在drawable-v21
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="#FFAEAE">
<item android:id="@android:id/mask">
<shape android:shape="rectangle">
<solid android:color="#FFAEAE" />
</shape>
</item>
</ripple>
对你有用吗?是的,很好用,谢谢。
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/button_effect" <!-- putting is as background-->
android:clickable="true"
android:focusable="true">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Stackoverflow" />
</RelativeLayout>