andorid 中如何实现双击事件
项目需求:
android中只有单击和其他事件,其实都是由OnTouch事件演变而来;最近有项目要求双击全屏,所以就试着实现了下
具体实现如下:
1.MainActivity.java实现:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".MainActivity" > <Button android:id="@+id/ontourch" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/hello_world" /></RelativeLayout>
好了实现就是这么简单;有问题可以@我