• 自定义NavigationBar


     [self.navigationController.navigationBarsetHidden:YES];

        CGRect screenRect = [[UIScreen mainScreen] bounds];

        UINavigationBar *navigationBar = [[UINavigationBar alloc]initWithFrame:CGRectMake(0, 0, screenRect.size.width, 64)];

        navigationBar.tintColor = [UIColor greenColor];

        navigationBar.alpha=0.3;

        //创建UINavigationItem

        UINavigationItem *navigationbarTitle = [[UINavigationItem alloc] initWithTitle:@"城市列表"];

        [navigationBar pushNavigationItem:navigationbarTitle animated:YES];

        navigationBar.backgroundColor =[UIColor clearColor];

        

        //创建UIBarButton

        UIBarButtonItem *itemL = [[UIBarButtonItemalloc]initWithBarButtonSystemItem:UIBarButtonSystemItemReplytarget:selfaction:@selector(navigationBackButton:)];

        UIBarButtonItem *itemR = [[UIBarButtonItemalloc]initWithBarButtonSystemItem:UIBarButtonSystemItemCameratarget:selfaction:@selector(navigationBackButton:)];

        

        //设置BarButton

        navigationbarTitle.leftBarButtonItem = itemL;

        navigationbarTitle.rightBarButtonItem = itemR;

        [navigationBar setItems:[NSArray arrayWithObject:navigationbarTitle]];

        [self.imageView addSubview:navigationBar];

  • 相关阅读:
    SVM的新理解
    特征提取,特征选择
    条件随机场
    分类、检测、识别
    matlab fgetl()
    matlab fopen()
    rar ubuntu
    makefile for opencv
    [洛谷P1231] 教辅的组成
    [洛谷P1514]引水入城
  • 原文地址:https://www.cnblogs.com/huntaiji/p/3491270.html
Copyright © 2020-2023  润新知