读书人

UINavigation自定义回来按钮

发布时间: 2013-08-11 22:22:29 作者: rapoo

UINavigation自定义返回按钮

UIButton *imageButton = [UIButton buttonWithType:UIButtonTypeCustom];[imageButton setFrame:CGRectMake(15, 0, 57, 44)];[imageButton setBackgroundImage:[UIImage imageNamed:@"someImage.png"] forState:UIControlStateNormal];UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(140, 0, 250, 44)];[titleLabel setText:@"some title"];[titleLabel setBackgroundColor:[UIColor clearColor]];[titleLabel setTextColor:[UIColor whiteColor]];[titleLabel setFont:[UIFont boldSystemFontOfSize:20]];[self.navigationController.navigationBar addSubview:imageButton];[self.navigationController.navigationBar addSubview:titleLabel];self.navigationItem.leftBarButtonItem = nil;

读书人网 >移动开发

热点推荐