点击一个按钮,弹出6个按钮
一个 点击 按钮 弹出
2023-09-27 14:28:40 时间
一,效果图。
二,工程图。
三,代码。
RootViewController.h
#import <UIKit/UIKit.h>
//加入头文件
#import "DCPathButton.h"
@interface RootViewController : UIViewController
<DCPathButtonDelegate>
@end
RootViewController.m
#import "RootViewController.h"
@interface RootViewController ()
@end
@implementation RootViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
self.view.frame = CGRectMake(0, 0, 320, 460);
self.view.backgroundColor = [UIColor whiteColor];
DCPathButton *dcPathButton = [[DCPathButton alloc]
initDCPathButtonWithSubButtons:6
totalRadius:60
centerRadius:15
subRadius:15
centerImage:@"custom_center"
centerBackground:nil
subImages:^(DCPathButton *dc){
[dc subButtonImage:@"custom_1" withTag:0];
[dc subButtonImage:@"custom_2" withTag:1];
[dc subButtonImage:@"custom_3" withTag:2];
[dc subButtonImage:@"custom_4" withTag:3];
[dc subButtonImage:@"custom_5" withTag:4];
[dc subButtonImage:@"custom_1" withTag:5];
}
subImageBackground:nil
inLocationX:0 locationY:0 toParentView:self.view];
dcPathButton.delegate = self;
}
#pragma mark - DCPathButton delegate
- (void)button_0_action{
NSLog(@"Button Press Tag 0!!");
}
- (void)button_1_action{
NSLog(@"Button Press Tag 1!!");
}
- (void)button_2_action{
NSLog(@"Button Press Tag 2!!");
}
- (void)button_3_action{
NSLog(@"Button Press Tag 3!!");
}
- (void)button_4_action{
NSLog(@"Button Press Tag 4!!");
}
- (void)button_5_action{
NSLog(@"Button Press Tag 5!!");
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
相关文章
- Tensorflow 实战:一个简单的二分类模型
- AI比赛-推荐系统(一)-新闻推荐02:训练item词向量【每篇新闻文章对应一个词向量】【word2vec:将每个用户点击的新闻文章序列作为输入(类似文本序列),训练出每篇文章的向量表示】【天池】
- 从0开始构建一个属于你自己的PHP框架
- DWZ (JUI)多个tabs,如何实现点击另一个tab时之前网页的ajax请求失效?
- vue -js 点击一个按钮 触发 另外一个按钮的方法
- 【Layui】关于做了分页后点击删除按钮无效(或者在任何框架点击一个按钮无效解决方案)
- 如何捕获一个Activity页面上所有的点击行为
- 作为一个前端开发者必备的技能
- PyQt(Python+Qt)学习随笔:在一个窗口点击按钮弹出另一个窗口的实现方法及注意事项
- 关于WCF的一个非常“无语”的BUG!
- 一个简单的win32窗口
- 如何设计一个 GUI 框架 之 QdUI
- 李洪强iOS经典面试题30-一个区分度很大的面试题
- 如何在mtk kernel中新添加一个摄像头驱动
- 嵌入式C实战项目开发技巧:如果对一个有规律的数组表进行位移操作
- qt之 使程序只运行一个实例,若再次点击exe则将已运行的实例置在最顶层显示
- Protocol 模拟UI中一个按钮点击改变lable中的值