Android编程实现仿优酷旋转菜单效果(附demo源码下载)

2019-12-10 19:43:54王旭
易采站长站为您分析Android编程实现仿优酷旋转菜单效果的方法,较为详细的分析了Android实现旋转菜单的布局与功能实现技巧,并附带完整的demo源码供读者下载参考,需要的朋友可以参考下  

本文实例讲述了Android编程实现仿优酷旋转菜单效果。,具体如下:

首先,看下效果:

Android编程实现仿优酷旋转菜单效果(附demo源码下载)

Android编程实现仿优酷旋转菜单效果(附demo源码下载)

不好意思,不会制作动态图片,只好上传静态的了,如果谁会,请教教我吧。

首先,看下xml文件:

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://www.easck.com/apk/res/android" 
  android:layout_width="fill_parent" 
  android:layout_height="fill_parent" 
  android:background="#c9c9c9" > 
  <RelativeLayout 
    android:id="@+id/relate_level3" 
    android:layout_width="280dp" 
    android:layout_height="140dp" 
    android:layout_alignParentBottom="true" 
    android:layout_centerHorizontal="true" 
    android:background="@drawable/level3" > 
    <ImageButton 
     android:id="@+id/c1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentBottom="true" 
     android:layout_marginBottom="6dip" 
     android:layout_marginLeft="12dip" 
     android:background="@drawable/channel1" /> 
    <ImageButton 
     android:id="@+id/c2" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_above="@+id/c1" 
     android:layout_marginBottom="12dip" 
     android:layout_marginLeft="28dip" 
     android:background="@drawable/channel2" /> 
    <ImageButton 
     android:id="@+id/c3" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_above="@+id/c2" 
     android:layout_marginBottom="8dip" 
     android:layout_marginLeft="6dip" 
     android:layout_toRightOf="@+id/c2" 
     android:background="@drawable/channel3" /> 
    <ImageButton 
     android:id="@+id/c4" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_centerHorizontal="true" 
     android:layout_margin="6dip" 
     android:background="@drawable/channel4" /> 
    <ImageButton 
     android:id="@+id/c5" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_above="@+id/c6" 
     android:layout_marginBottom="8dip" 
     android:layout_marginRight="6dip" 
     android:layout_toLeftOf="@+id/c6" 
     android:background="@drawable/channel5" /> 
    <ImageButton 
     android:id="@+id/c6" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_above="@+id/c7" 
     android:layout_alignParentRight="true" 
     android:layout_marginBottom="12dip" 
     android:layout_marginRight="28dip" 
     android:background="@drawable/channel6" /> 
    <ImageButton 
     android:id="@+id/c7" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentBottom="true" 
     android:layout_alignParentRight="true" 
     android:layout_marginBottom="6dip" 
     android:layout_marginRight="12dip" 
     android:background="@drawable/channel7" /> 
  </RelativeLayout> 
  <RelativeLayout 
    android:id="@+id/relate_level2" 
    android:layout_width="180dp" 
    android:layout_height="90dp" 
    android:layout_alignParentBottom="true" 
    android:layout_centerHorizontal="true" 
    android:background="@drawable/level2" > 
    <ImageButton 
     android:id="@+id/menu" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_centerHorizontal="true" 
     android:layout_margin="6dip" 
     android:background="@drawable/icon_menu" /> 
    <ImageButton 
     android:id="@+id/search" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentBottom="true" 
     android:layout_margin="10dip" 
     android:background="@drawable/icon_search" /> 
    <ImageButton 
     android:id="@+id/myyouku" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentBottom="true" 
     android:layout_alignParentRight="true" 
     android:layout_margin="10dip" 
     android:background="@drawable/icon_myyouku" /> 
  </RelativeLayout> 
  <RelativeLayout 
    android:id="@+id/relate_level1" 
    android:layout_width="100dp" 
    android:layout_height="50dp" 
    android:layout_alignParentBottom="true" 
    android:layout_centerHorizontal="true" 
    android:background="@drawable/level1" > 
    <ImageButton 
     android:id="@+id/home" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentBottom="true" 
     android:layout_centerHorizontal="true" 
     android:layout_marginBottom="10dp" 
     android:background="@drawable/icon_home" /> 
  </RelativeLayout> 
</RelativeLayout>