zoukankan      html  css  js  c++  java
  • iOS tabbar 背景,右上角数字,tabbar获取方法 总结

    //tabbar选中时的颜色

        tabBarController.tabBar.tintColor=[UIColor whiteColor] ;

       

    //右上角数字

        //可以添加个lable来改变原点的大小,

        //使用通知/kvo来改变上面的数字

         item1.badgeValue=@" “;

        

    //tabBarItem获取方法:

        [[[tabBarController tabBar] items] objectAtIndex:i];

    //设置标签栏的背景图片 2中方式

    1. [tab setBackgroundImage:[UIImage imageNamed:@"导航栏@2x.png"]];//设置背景

    2. UIImage *image=[UIImage imageNamed:@"导航栏@2x.png"];

        UIImageView *imageView = [[UIImageView alloc] initWithFrame:

                                CGRectMake(0, -15,tab.frame.size.width, tab.frame.size.height+15)];//相对位置的修改

        imageView.image =image;

        [tab  insertSubview:imageView  atIndex:0];//插入的位置

  • 相关阅读:
    Codeforces Round #439 (Div. 2)
    Money Systems
    Stamps
    inflate
    多重背包问题
    AIM Tech Round 4 (Div. 2)
    September Challenge 2017
    树的重心
    百度之星2017初赛A
    树上的最大独立集
  • 原文地址:https://www.cnblogs.com/cfl911014/p/4840404.html
Copyright © 2011-2022 走看看