当前位置: 代码迷 >> Iphone >> 仿iPhone assistivetouch小工具实现详解零
  详细解决方案

仿iPhone assistivetouch小工具实现详解零

热度:84   发布时间:2016-04-25 05:48:35.0
仿iPhone assistivetouch小工具实现详解0

大家都知道iPhone下的assistivetouch这个小圆点


对,就是这个玩意儿

但是Android上没这玩意儿,所有今天我们就给Android上弄上一个这个玩意儿


看见没,和iPhone下的基本一样吧

我准备分几次讲这个项目的开发实例写出来,照例,今天搞定界面:

1、控制球界面

2、菜单界面

这些都不难,大家看下就懂了

控制球界面:

<?xml version="1.0" encoding="utf-8"?><FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="wrap_content"    android:layout_height="wrap_content"    android:layout_gravity="center_vertical"    android:orientation="vertical" >    <Button        android:id="@+id/touch_ball"        android:layout_width="50dp"        android:layout_height="50dp"        android:background="@drawable/selector_btn_assistive" /></FrameLayout>

菜单界面:

<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:id="@+id/lay_main"    android:layout_width="300dp"    android:layout_height="300dp"    android:background="@drawable/shape_background_assistivetouch"    android:padding="4.0px" >    <TextView        android:id="@+id/tv_apps"        style="@style/Icon"        android:layout_centerInParent="true"        android:drawableTop="@drawable/selector_ic_apps"        android:text="apps" />    <TextView        android:id="@+id/tv_home_screen"        style="@style/Icon"        android:layout_alignParentBottom="true"        android:layout_centerHorizontal="true"        android:drawableTop="@drawable/selector_ic_home"        android:text="home_screen" />    <TextView        android:id="@+id/tv_setting"        style="@style/Icon"        android:layout_alignParentRight="true"        android:layout_centerVertical="true"        android:drawableTop="@drawable/selector_ic_phone"        android:text="setting" />    <TextView        android:id="@+id/tv_lock_screen"        style="@style/Icon"        android:layout_centerHorizontal="true"        android:drawableTop="@drawable/selector_ic_power_down"        android:text="lock_screen" />    <TextView        android:id="@+id/tv_favor"        style="@style/Icon"        android:layout_alignParentLeft="true"        android:layout_centerVertical="true"        android:drawableTop="@drawable/selector_ic_star"        android:text="favor" /></RelativeLayout>

图片的背景大多采用Selector选择器,用来实现点击效果

ok,今天的任务比较简单,界面搞定。

明天的预定:

1、实现控制球的点击拖动

2、点击控制球后弹出菜单选择界面

3、菜单选择功能


ps:需要源码的朋友请留言,tks

1楼sara_loveyou昨天 23:19
good job,492038278@qq.com, thx
  相关解决方案