IOS被遗忘的知识
2024-10-13 12:53:34
IOS ARC项目使用非ARC文件
1.自己的旧项目没有使用ARC,可是引入的第三方库却是使用了ARC的。
对于第一个情况,给採用了ARC的源文件,加入-fobjc-arc选项
2.自己的新项目使用了ARC,可是引入的第三方库或者曾经写的代码却没有使用ARC。
2.自己的新项目使用了ARC,可是引入的第三方库或者曾经写的代码却没有使用ARC。
对于另外一种情况,加入-fno-objc-arc
改动NavigationController的后退button标题
A push到B 。改动B的返回标题
仅仅要在A中加入以下的代码
<span style="font-size:18px;">UIBarButtonItem *backItem = [[UIBarButtonItem alloc] init];
backItem.title = @"返回";
self.navigationItem.backBarButtonItem = backItem;</span>
- (instancetype)initWithNavigationBarClass:(Class)navigationBarClass toolbarClass:(Class)toolbarClassNS_AVAILABLE_IOS(5_0);
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; UINavigationController *navigationController = [[UINavigationController alloc] initWithNavigationBarClass:[CRGradientNavigationBar class] toolbarClass:nil]; UIColor *firstColor = [UIColor colorWithRed:255.0f/255.0f green:42.0f/255.0f blue:104.0f/255.0f alpha:1.0f];
UIColor *secondColor = [UIColor colorWithRed:255.0f/255.0f green:90.0f/255.0f blue:58.0f/255.0f alpha:1.0f]; NSArray *colors = [NSArray arrayWithObjects:(id)firstColor.CGColor, (id)secondColor.CGColor, nil];
//NSArray *colors = [NSArray arrayWithObjects:(id)UIColorFromRGB(0xf16149).CGColor, (id)UIColorFromRGB(0xf14959).CGColor, nil]; [[CRGradientNavigationBar appearance] setBarTintGradientColors:colors];
[[navigationController navigationBar] setTranslucent:NO]; // Remember, the default value is YES. DemoViewController *viewController = [[DemoViewController alloc] init];
[navigationController setViewControllers:@[viewController]]; [self.window setRootViewController:navigationController]; self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return YES;
}
版权声明:本文博客原创文章。博客,未经同意,不得转载。
最新文章
- C# 使用AForge调用笔记本摄像头拍照
- Matches正则使用提取内容
- Java语言面向对象的一些基本特点
- Python的标准输出
- Linux网关配置(centos6)
- DataTable转List<;Model>;通用类
- jQuery对表单、表格的操作及更多应用(下:其他应用)
- 阿里云实战之二(mysql+phpmyadmin)
- Arduino uno R3 ISP刷Rootloader for arduino pro mini
- 37. Sudoku Solver
- hdu4111 Alice and Bob
- css中的定位
- this的理解
- 项目Alpha冲刺Day12
- IntelliJ IDEA 配置maven
- 【转】Python——plot可视化数据,作业8
- 当你的layui表格要做全选+删除功能【兼容ie8】
- Confluence 6 从站点首页集中访问面板
- pytorch实现花朵数据集读取
- powerdesigner 实体关系模型CDM与物理数据模型PDM互转
热门文章
- WPF学习(8)数据绑定
- 谁占用了我的Buffer Pool
- boostrap-非常好用但是容易让人忽略的地方------modal
- CPU 风扇清理灰尘加油全过程图解
- SharePoint 2013 禁用搜索服务
- Asp.Netserver控制发展Grid实现(一个)UI转让
- Net 一个请求的处理流程
- JavaScript通告/订阅的例子
- 为 Oracle Database 开发 WCF Data Services 和 OData 应用程序
- cocos2dx 3.1.1移植安卓apk (lua交叉编译器项目 mac环境)