界面重下到上弹出,
弹出方法
addResumes为要弹出的画面对象
addResumes=[[AddResumes alloc]initWithNibName:@"AddResumes" bundle:nil];
// [self.navigationController pushViewController:addResumes animated:YES];
nav=[[UINavigationController alloc]initWithRootViewController:addResumes];
[self.navigationController presentModalViewController:nav animated:YES];
返回时调用方法[self.navigationController dismissModalViewControllerAnimated:YES];
这一对方法是将控制权转交给下个navigationcontroller控制,和左右不一样,左右是将目前界面往堆栈里面压,将新的界面添加进来
左右对应的方法为
[self.navigationController pushViewController:resumeDetail animated:YES];
[self.navigationController popViewControllerAnimated:YES];
更多此类方法看api。自定义navigation 按钮方法
UIBarButtonItem *rightbuttonitem=[[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"nav_btn_email.png"]
style:UIBarButtonItemStylePlain
target:self
action:@selector(mailway)];
self.navigationItem.rightBarButtonItem=rightbuttonitem;
修改navigationtitle字体什么的,添加视图,想怎么改怎么改
UILabel *navtitle=[[UILabel alloc]init];
[navtitle setFont:[UIFont fontWithName:@"TimesNewRomanPS-BoldMT" size:20]];
[navtitle setText:@"Objective"];
navtitle.textColor=[UIColor whiteColor];
[navtitle setFrame:CGRectMake( -70, -13, 140, 25)];
navtitle.textAlignment=UITextAlignmentCenter;
[navtitle setBackgroundColor:[UIColor clearColor]];
navtitle.shadowColor=[UIColor darkGrayColor];
[navtitle setShadowOffset:CGSizeMake(-0.5, -1)];
UIView *myview=[[UIView alloc]init];
[myview addSubview:navtitle];
[navtitle release];
[self.navigationItem setTitleView:myview];
[myview release];
本文详细介绍了iOS应用中界面弹出与导航的操作方法,包括如何使用UINavigationController进行界面切换,以及如何自定义导航栏按钮和修改导航栏标题样式。通过实例演示,帮助开发者掌握界面管理与导航控制的基本技能。
1160

被折叠的 条评论
为什么被折叠?



