/ Published in: Objective C
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
- (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; tableViewNavigationBar = [[UINavigationBar alloc] initWithFrame: CGRectMake(0.0f, 0.0f, 320.0f, 44.0f)]; UIImage *image = [UIImage imageNamed:@"synyx_150_no_os.png"]; imageView = [ [ UIImageView alloc ] initWithFrame:CGRectMake(84.0, 1.0, image.size.width, image.size.height) ]; [imageView setImage:image]; [tableViewNavigationBar addSubview:imageView]; [super.tableView addSubview:tableViewNavigationBar]; } //This is the way i implemented in a Tab Bar Window - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; //navigationBar = [[UINavigationBar alloc] initWithFrame: CGRectMake(0.0f, 0.0f, 320.0f, 44.0f)]; UIImage *image = [UIImage imageNamed:@"cpSmallLogoB.png"]; UIImageView *imageView = [ [ UIImageView alloc ] initWithFrame:CGRectMake(84.0, 22.0, image.size.width, image.size.height) ]; [imageView setImage:image]; //[navigationBar addSubview:imageView]; [super.navigationController.view addSubview:imageView]; }
URL: http://dlinsin.blogspot.com/2010/01/adding-uinavigationbar-to-uitableview.html