iOS 在键盘上附加工具栏

释放双眼,带上耳机,听听看~!
-(UIView*)inputAccessoryView{

CGRectaccessFrame=CGRectMake(0,0,768,35);

UIToolbar*toolbar= [[UIToolbaralloc]initWithFrame:accessFrame];

UIButton*nextButton=[UIButtonbuttonWithType:UIButtonTypeCustom];

nextButton.tag=0;

nextButton.layer.cornerRadius = 5;//设置那个圆角的有多圆

[nextButtonsetFrame:CGRectMake(0,0,50,35)];

[nextButtonsetTintColor:[UIColorblackColor]];

[nextButtonsetTitleColor:[UIColorblackColor]forState:UIControlStateNormal];

[nextButtonsetTitle:@"Next"forState:UIControlStateNormal];

nextButton.titleLabel.font= [UIFontsystemFontOfSize:15];

[nextButtonaddTarget:selfaction:@selector(toolbarButton:)forControlEvents:UIControlEventTouchUpInside];

[toolbaraddSubview:nextButton];



UIButton*okButton=[UIButtonbuttonWithType:UIButtonTypeCustom];

okButton.tag=1;

okButton.layer.cornerRadius = 5;//设置那个圆角的有多圆

[okButtonsetFrame:CGRectMake(ScreenWidth-50,0,50,35)];

[okButtonsetTintColor:[UIColorblackColor]];

[okButtonsetTitleColor:[UIColorblackColor]forState:UIControlStateNormal];

[okButtonsetTitle:@"确定"forState:UIControlStateNormal];

okButton.titleLabel.font= [UIFontsystemFontOfSize:15];

[okButtonaddTarget:selfaction:@selector(toolbarButton:)forControlEvents:UIControlEventTouchUpInside];

[toolbaraddSubview:okButton];

returntoolbar;

}

 

人已赞赏
iOS文章

"OBJC_CLASS_$_XXXX_",referenced from: objc_class-ref in xxxx

2019-11-30 14:54:59

iOS文章

iOS APP 跳转系统发送短信功能

2019-11-30 19:25:26

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
有新消息 消息中心
搜索