iOS 7 的变化,UITabBarItem

来源:互联网 发布:闲在家里的日子 知乎 编辑:程序博客网 时间:2024/05/29 10:17

if( ([[[UIDevicecurrentDevice] systemVersion]doubleValue]>=7.0)) {

        tabBarItemImage = [tabBarItemImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

        tabBarItemSeletedImage = [tabBarItemSeletedImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

        tabBarItem = [[UITabBarItem alloc] initWithTitle:@"会员" image:tabBarItemImage selectedImage:tabBarItemSeletedImage];

        [selfresetTabbarItemTextColor:tabBarItem];

    } 

//修改tab的字体颜色。

- (void) resetTabbarItemTextColor:(UITabBarItem *) tabBarItem{

    

    [tabBarItem setTitleTextAttributes:[NSDictionarydictionaryWithObjectsAndKeys:

                                        [UIColorwhiteColor], UITextAttributeTextColor,

                                       nil] forState:UIControlStateNormal];

    [tabBarItem setTitleTextAttributes:[NSDictionarydictionaryWithObjectsAndKeys:

                                        [UIColorwhiteColor], UITextAttributeTextColor,

                                       nil] forState:UIControlStateHighlighted];

}


    //NavigationBarUIViewController重叠的问题。

    if( ([[[UIDevicecurrentDevice] systemVersion]doubleValue]>=7.0)) {

       self.edgesForExtendedLayout= UIRectEdgeNone;

    }


0 0
原创粉丝点击