工作小tips

1: 设置导航栏为透明
[self.navigationController.navigationBar subviews] objectAtIndex:0].alpha =0

http://blog.csdn.net/w_shuiping/article/details/50403617

http://blog.sina.com.cn/s/blog_4cd8dd1301014cvd.html

2: 设置状态栏的barItem的title的颜色
工作小tips_第1张图片
UINavigationBar.appearance().tintColor = UIColor.cyan
3: 设置图片作为背景

http://www.cnblogs.com/mancong/archive/2015/12/02/5013814.html

4>: app评分

http://www.jianshu.com/p/f2d3f5b3e0b3

5: Ipv6的测试

http://www.cocoachina.com/ios/20160525/16431.html

6: image的居中显示

http://blog.csdn.net/zhoutao198712/article/details/8762012

7: 读取系统的消息

http://blog.csdn.net/bitcser/article/details/53944777

8: 读取网页的标题

http://blog.csdn.net/zhaoweizheng66/article/details/51084395
http://www.cnblogs.com/junhuawang/p/5759224.html

9: 获取label的宽度和高度

http://blog.csdn.net/c_calary/article/details/53037958

10: tableView整体上移时的解决方案
11: 检查iOS项目中是否使用了IDFA

http://www.jianshu.com/p/23479325dfb0
http://www.jianshu.com/p/78d1fbc24e77
http://www.jianshu.com/u/07e63e5fb4ab
http://www.jianshu.com/p/e38c8c514af7
http://www.jianshu.com/p/3ef714214405

11: wkwebView增加进度条

http://www.jianshu.com/p/85ae953380f9

12:审核被拒

https://www.zhihu.com/question/33191327/answer/56159182

13: WKWebView的scrollView设置代理崩溃

http://www.jianshu.com/p/fb6df83f7ebd
http://blog.csdn.net/june_email/article/details/51282415

14: iOS开发Xcode崩溃在main函数入口时如何定位Bug

http://blog.csdn.net/deft_mkjing/article/details/53117341

15: CocoaPods更新工程后编译提示Pods-framework.sh:No Such File or Directo

http://blog.csdn.net/deft_mkjing/article/details/51867719

16: 百度推送30000

http://www.jianshu.com/p/acdf9efe2066
http://blog.csdn.net/u010731949/article/details/52555768

17 推送的坑

http://www.jianshu.com/u/f8650cb2b4eb
http://www.jianshu.com/p/a7384c6d0008 杀死app 保证点击推送通知跳转到相应的界面

18 设置导航栏的背景色

如果全局的设置导航栏的背景色

UINavigationBar.appearance().barTintColor = UIColor.red
19: 设置状态栏的状态
  • 1: 设置info.plistView controller-based status bar appearance设置为YES

    工作小tips_第2张图片
    设置控制器管理状态栏

  • 2: // 设置状态拦的状态
    如果有导航栏 需要在自定义的导航栏设置
    如果没有就可以在当前的控制器设置

  // 设置状态拦的状态
  override var preferredStatusBarStyle: UIStatusBarStyle{
    return .lightContent
  }
20: 怎样设置navigationItem的间距

遇到self.navigationItem.rightBarButtonItems设置多个UIBarButtionItem 这时候我们需要每个之间有一定的间距 怎么设置那??

   let marginItem = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.fixedSpace, target: nil, action: nil)
    marginItem.width = 20
21: 设置导航栏的标题的颜色和字体
工作小tips_第3张图片
设置导航栏的标题的颜色和字体

思路: 在当前的控制器下设置attrubi

 self.navigationController?.navigationBar.titleTextAttributes =[NSForegroundColorAttributeName:UIColor.white,
 NSFontAttributeName:UIFont.boldSystemFont(ofSize: 18)]
22: 设置UIImage的渲染方式
 UIImage(named: "search@2x")?.withRenderingMode(UIImageRenderingMode.alwaysOriginal)
23:设置TabBar的背景色和每一个title的颜色
  UITabBar.appearance().tintColor = UIColor.blue
  UITabBar.appearance().barTintColor = UIColor.yellow
24:设置导航标题的颜色和字体
let attDic = NSMutableDictionary(dictionary: [NSFontAttributeName:UIFont.systemFont(ofSize: 16), NSForegroundColorAttributeName:UIColor.white])
navigationController?.navigationBar.titleTextAttributes = attDic as? [String : Any]
25: 跳转到appStore评论界面
NSString * commontStr = @"itms-apps://itunes.apple.com/cn/app/idxxxxxx?mt=8&action=write-review";
NSURL *url = [NSURL URLWithString:commontStr];
[[UIApplication sharedApplication] openURL:url];
26: 输入框抖动效果
CAKeyframeAnimation *shake = [CAKeyframeAnimation animationWithKeyPath:@"position.x"];
    shake.values = @[@0,@-10,@10,@-10,@0];
    shake.additive = YES;
    shake.duration = 0.25;
    [view.layer addAnimation:shake forKey:@"shake"];

你可能感兴趣的:(工作小tips)