阅读背景:

Android 长按Button出现一个菜单

来源:互联网 

效果图:

图1:

在这里插入图片描述

图2:

在这里插入图片描述

图3:

在这里插入图片描述

activity_main.xml:

<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="https://schemas.android.com/apk/res/android" xmlns:app="https://schemas.android.com/apk/res-auto" xmlns:tools="https://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <Button android:id="@+id/btn_long" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:text="长按我" android:textSize="20dp" android:background="#00aef2" android:textColor="#fff"/> </RelativeLayout> <?xml version="1.0



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: