具有切换动画的圆形菜单。您还可以自定义按钮数量(1 ~ 6)。
此控件与 iPokeMon (一款 iOS 基于位置的服务 Pokémon 游戏)分离,您可以看看演示视频,看看它有多么酷!
使用下面的指定初始化器初始化圆形菜单
// |buttonCount| : count of buttons around (1<= x <=6)
// |menuSize| : size of menu
// |buttonSize| : size of buttons around
// |buttonImageNameFormat| : name format for button image
// |centerButtonSize| : size of center button
// |centerButtonImageName| : name for center button image
// |centerButtonBackgroundImageName| : name for center button background image
- (id) initWithButtonCount:(NSInteger)buttonCount
menuSize:(CGFloat)menuSize
buttonSize:(CGFloat)buttonSize
buttonImageNameFormat:(NSString *)buttonImageNameFormat
centerButtonSize:(CGFloat)centerButtonSize
centerButtonImageName:(NSString *)centerButtonImageName
centerButtonBackgroundImageName:(NSString *)centerButtonBackgroundImageName;
覆盖 -runButtonActions:
消息以自定义按钮动作
- (void)runButtonActions:(id)sender {
[super runButtonActions:sender];
// Do buttons' action appropriately by |[sender tag]|
// ...
}
标签的定义如下
TAG: 1 1 2 1 2 1 2 1 2 3 1 2 3
\|/ \|/ \|/ \|/ \|/ \|/
COUNT: 1) --|-- 2) --|-- 3) --|-- 4) --|-- 5) --|-- 6) --|--
/|\ /|\ /|\ /|\ /|\ /|\
TAG: 3 3 4 4 5 4 5 6
默认情况下,导航栏仅在小视图中显示。如果要与圆形菜单一起显示,请将以下宏添加到
#define KY_CIRCLEMENU_WITH_NAVIGATIONBAR 1
您的 constatns.h 或 config.h,或任何其他导入到 <Project>-Prefix.pch 的文件。
本代码根据 MIT 许可证的条款和条件进行分发。