您的位置:首页 > 移动开发 > IOS开发

ios一些开发中遇到的小知识点

2012-07-27 12:40 260 查看
界面重下到上弹出,

弹出方法

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];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: