-(BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController { if (viewController =...
分类:
其他好文 时间:
2015-07-27 12:52:41
阅读次数:
81
本人apem说到UITabBarController, 最首要的坑就是tabbar的图片不显示的问题1. tabbar上的图片一定要2套以上, 例如一个uitabbaritem的image是 search.png, 那就必须要又search@2x.png才能显示, 否则图片内容显示不出来.2. ta...
分类:
其他好文 时间:
2015-07-23 15:26:06
阅读次数:
96
UITabBarController:以平行的方式管理视图,各个视图之间往往关系并不大,每个加入到UITabBarController的视图都会进行初始化即使当前不显示在界面上,相对比较占用内存。UINavigationController:以栈的方式管理视图,各个视图的切换就是压栈和出栈操作,出栈...
分类:
其他好文 时间:
2015-07-22 18:30:24
阅读次数:
110
在做项目的时候,如果使用系统的UITabBarController的时候,底部的tab自定义图片显示是蓝色和灰色的,这不是我们所想要的效果。
如果想显示自定义的按下和弹起的图片效果,这个时候就需要对TabBarItem进行修改。
以下就是具体的示例:
var itemNameArray:[String] = ["down_32","add_32","plane_32","circle_32"...
分类:
编程语言 时间:
2015-07-19 23:38:54
阅读次数:
155
之前虽然也手写过这两中视图控制器,但是更多的还是使用SB来创建,最近发现了一些问题,现在总结一下。1.改变UINavigationBar的颜色在UINavigationController中,之前只需要设置UINavigationController.navigationBar.tintColor ...
分类:
其他好文 时间:
2015-07-18 12:13:57
阅读次数:
181
push页面时,可调用hidesBottomBarWhenPushed进行隐藏。第一步,我们需要一些图片:各个选项的图标和tabbar的背景图片,最后还要一个透明的1x1像素的图片。第二步,新建一个工程,在工程内建一个继承于UITabBarController的类。第三步,首先写一个方法,返回一个U...
分类:
其他好文 时间:
2015-07-17 13:39:15
阅读次数:
123
首先我们需要搭建一个空的项目,当然xcode6.0以后不支持直接创建空项目,所以我们需要在系统生成项目之后,删除xcode自动给你生成的控制器和storyboard,另外需要在Main Interface 处将之前的main删除。如图所示:然后我们需要在Appdelegate.m文件中的- (BOO...
分类:
其他好文 时间:
2015-07-17 11:23:49
阅读次数:
122
建立控制器 // 普通控制器
GroupViewController *groupVC = [[GroupViewController alloc] init];
SecondViewController *secondVC = [[SecondViewController alloc] init];
ThirdViewController *thirdVC = [[T...
分类:
其他好文 时间:
2015-07-16 16:53:27
阅读次数:
88
首先设置UITabBarController的代理为appdelegate如下:myTabBar.delegate = self; 然后在interface后面写上代理<UITabBarControllerDelegate> 实现代理里面的- (BOOL)tabBarController:(UITabBarController *)ta...
分类:
移动开发 时间:
2015-07-14 15:51:09
阅读次数:
189
直接上代码://
// AppDelegate.m
//
//#import "AppDelegate.h"
#import "RootViewController.h"
#import "FirstViewController.h"
#import "SecnodViewController.h"
#import "ThirdViewController.h"
@interface AppDel...
分类:
其他好文 时间:
2015-07-14 11:44:07
阅读次数:
148