Youku Ring Menu
Layout file, using the <RelativeLayout/> Control as the first level menu, relative to the layout, at the bottom of the parent control, horizontally centered, because the picture is not a special standard, so the width and height are nailed, width is twice times the height
Two menus and three-level menus are the same layout
Small house icons <imageView/> controls, centering in parent controls
Second level search icon, located at the bottom of the parent control, up or down maigin10dp
Second level menu icon, at the top of the parent control, centered horizontally,margintop 10DP
Second-level exclamation mark icon, located at the bottom of the parent control, to the right,margin 10DP
The third level of the icon is more, but the same principle as the second level, only through the margin to locate
The third-level channel2 icon, located on top of the channel1 icon , aligns to the left of the Channel1, MarginLeft 20dp,marginbottom 6DP
The third-level channel3 icon, located on top of the channel2 icon , aligns to the left of the Channel2 , marginleft 30DP , marginbottom 6DP
Third-level channel4 icon, located above the parent control, centered horizontally,margintop 5DP
Left semicircular end, right semicircle and left side same steps
Layout code:
<Relativelayoutxmlns: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"Tools:context= "${relativepackage}.${activityclass}" > <RelativelayoutAndroid:layout_width= "100DP"Android:layout_height= "50DP"Android:layout_alignparentbottom= "true"Android:layout_centerhorizontal= "true"Android:background= "@drawable/level1" > <ImageViewAndroid:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"android:layout_centerinparent= "true"Android:background= "@drawable/icon_home" /> </Relativelayout> <RelativelayoutAndroid:layout_width= "180DP"Android:layout_height= "90DP"Android:layout_alignparentbottom= "true"Android:layout_centerhorizontal= "true"Android:background= "@drawable/level2" > <ImageViewAndroid:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:layout_alignparentbottom= "true"Android:layout_margin= "10DP"Android:background= "@drawable/icon_search" /> <ImageViewAndroid:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:layout_centerhorizontal= "true"Android:layout_margintop= "5DP"Android:background= "@drawable/icon_menu" /> <ImageViewAndroid:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:layout_alignparentbottom= "true"Android:layout_alignparentright= "true"Android:layout_margin= "10DP"Android:background= "@drawable/icon_myyouku" /> </Relativelayout> <RelativelayoutAndroid:layout_width= "280DP"Android:layout_height= "140DP"Android:layout_alignparentbottom= "true"Android:layout_centerhorizontal= "true"Android:background= "@drawable/level3" > <ImageViewAndroid:id= "@+id/channel1"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:layout_alignparentbottom= "true"Android:layout_alignparentleft= "true"Android:layout_marginbottom= "10DP"Android:layout_marginleft= "10DP"Android:background= "@drawable/channel1" /> <ImageViewAndroid:id= "@+id/channel2"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:layout_above= "@id/channel1"Android:layout_alignleft= "@id/channel1"Android:layout_marginbottom= "10DP"Android:layout_marginleft= "20DP"Android:background= "@drawable/channel2" /> <ImageViewAndroid:id= "@+id/channel3"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:layout_above= "@id/channel2"Android:layout_alignleft= "@id/channel2"Android:layout_marginbottom= "10DP"Android:layout_marginleft= "34DP"Android:background= "@drawable/channel3" /> <ImageViewAndroid:id= "@+id/channel4"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:layout_margintop= "5DP"Android:layout_centerhorizontal= "true"Android:background= "@drawable/channel4" /> <ImageViewAndroid:id= "@+id/channel7"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:layout_alignparentbottom= "true"Android:layout_alignparentright= "true"Android:layout_marginbottom= "10DP"Android:layout_marginright= "10DP"Android:background= "@drawable/channel7" /> <ImageViewAndroid:id= "@+id/channel6"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:layout_above= "@id/channel7"Android:layout_alignright= "@id/channel7"Android:layout_marginbottom= "10DP"Android:layout_marginright= "20DP"Android:background= "@drawable/channel6" /> <ImageViewAndroid:id= "@+id/channel5"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:layout_above= "@id/channel6"Android:layout_alignright= "@id/channel6"Android:layout_marginbottom= "10DP"Android:layout_marginright= "34DP"Android:background= "@drawable/channel5" /> </Relativelayout></Relativelayout>
[Android] Youku ring menu-relative layout exercises