TabBar 使用注意事项

icon-image 渲染模式

UIImageRenderingModeAlwaysTemplate:带有tintColor 的渲染模式

UIImageRenderingModeAlwaysOriginal:展示图片的原来样式

[image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

icon-image 位置调整

图片设置过大,覆盖文字调整图片边距: self.imageInsets = UIEdgeInsetsMake(-10, 0, 10, 0);

特别要注意的是:

   top和bottom要设置成相反数,不然image的大小会一直改变

文字颜色设置

    [self setTitleTextAttributes:[NSDictionary
                                  dictionaryWithObjectsAndKeys: [UIColor colorWithRed:100.0 / 255.0 green:100.0 / 255.0 blue:100.0 / 255.0 alpha:1],
                                  NSForegroundColorAttributeName, nil] forState:UIControlStateSelected];
    [self setTitleTextAttributes:[NSDictionary
                                  dictionaryWithObjectsAndKeys: [UIColor brownColor],
                                  NSForegroundColorAttributeName, nil] forState:UIControlStateNormal];

隐藏topLine

[self.tabBar setShadowImage:[UIImage new]];

设置tabBar背景图片

self.tabBar.backgroundImage = [UIImage imageNamed:@"cm2_btm_bg"];
最近的文章

gdb/adb/lldb

GDB是一个由GNU开源组织发布的、UNIX/LINUX操作系统下的、基于命令行的、功能强大的程序调试工具。 对于一名Linux下工作的c++程序员,gdb是必不可少的工具;Android 调试桥 (adb) 是一个通用命令行工具,其允许您与模拟器实例或连接的 Android 设备进行通信。LLDB是个开源的内置于XCode的具有REPL(read-eval-print-loop)特征的Debugger,其可以安装C++或者Python插件。开发iOS程序的时候常常会用到调试跟踪。xcod...…

继续阅读
更早的文章

CocoaPods使用笔记

<font color = blue> 引入第三方的步骤</font> 新建 Podfile 文件 编辑 Podfile 文件(pod file 格式) pod install 去干别的事,等待完成。关闭项目,打开workSpace文件。下面是使用情况,我的工程叫做PicTool,接下来我的操作都是通过终端实现:➜ ~ cd /Users/zhengjiaohong/Desktop/_pod/PicTool ➜ PicTool touch Podfile...…

继续阅读