本文主要是介绍[iOS]模块化控制部分功能的展示与否,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
#ifndef UserInfoConfig_h
#define UserInfoConfig_h// 下载模块
#define WX_DownLoad_Mode 1// 微信分享
#define WX_W_Share_Mode 1// QQ分享
#define WX_Q_Share_Mode 1#endif
- (void)initialize {#if WX_DownLoad_ModeUIButton *downloadButton = [UIButton buttonWithType:UIButtonTypeCustom];
#if WX_W_Share_Mode || WX_Q_Share_ModedownloadButton.frame = CGRectMake(shareButton.left - PUB_HALF_MARGIN - 30, shareButton.top, 30, 30);
#elsedownloadButton.frame = CGRectMake(SCREEN_WIDTH - PUB_HALF_MARGIN - 30, PUB_NAVBAR_HEIGHT - 30 - PUB_QUARTER_MARGIN, 30, 30);
#endifdownloadButton.adjustsImageWhenHighlighted = NO;downloadButton.tintColor = Main_Text_WhiteColor;[downloadButton setImage:[[UIImage imageNamed:@"comic_download.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] forState:UIControlStateNormal];[downloadButton setImageEdgeInsets:UIEdgeInsetsMake(1, 3, 5, 3)];[downloadButton addTarget:self action:@selector(downloadButtonClick) forControlEvents:UIControlEventTouchUpInside];[self.navigationBar addSubview:downloadButton];
#endif}#pragma mark - 点击事件
#if WX_DownLoad_Mode- (void)downloadButtonClick {DownloadViewController *vc = [[DownloadViewController alloc] init];[self.navigationController pushViewController:vc animated:YES];
}#endif
这篇关于[iOS]模块化控制部分功能的展示与否的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!