UINavigationBar *navigationBar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
    navigationBar.tintColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"image_bottomBarBackground.png"]];
    
    UINavigationItem* navItem = [[UINavigationItem alloc] initWithTitle:@"查看"];
    
    UIBarButtonItem *backButton = [[UIBarButtonItem alloc]
                                   initWithImage:[UIImage imageNamed:@"backButton.png"]
                                   style:UIBarButtonItemStylePlain target:self
                                   action:@selector(backButtonClick)];
    navItem.leftBarButtonItem = backButton;
    [backButton release];
    
    
    
    [navigationBar pushNavigationItem:navItem animated:NO];
    [navItem release];
    
    [self.view addSubview:navigationBar];
    [navigationBar release];

版权声明:本文为zhangdadi原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/zhangdadi/archive/2012/11/21/2780117.html