NavigationItem 点击范围更改
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了NavigationItem 点击范围更改相关的知识,希望对你有一定的参考价值。
原文链接:http://www.jianshu.com/p/9c0dc91a3cf5
著作权归作者所有,转载请联系作者获得授权,并标注“简书作者”。
UIButton*button = [UIButtonbuttonWithType:UIButtonTypeCustom];
[buttonsetTitleEdgeInsets:insets];
[buttonsetFrame:CGRectMake(0,0,44,30)];
[buttonaddTarget:selfaction:actionforControlEvents:UIControlEventTouchUpInside];
[buttonsetTitle:textforState:UIControlStateNormal];
button.titleLabel.font= [UIFontsystemFontOfSize:14.0f];
[buttonsetTitleColor:[UIColorgrayColor]forState:UIControlStateNormal];
[buttonsetTitleColor:[UIColorhexStringToColor:@"808080"]forState:UIControlStateHighlighted];
[buttonsizeToFit];
[buttonsetFrame:CGRectMake(0,0, button.width+5,24)];
UIView*backBtnView = [[UIViewalloc]initWithFrame:button.bounds];
backBtnView.bounds=CGRectOffset(backBtnView.bounds,0,0);
[backBtnViewaddSubview:button];
以上是关于NavigationItem 点击范围更改的主要内容,如果未能解决你的问题,请参考以下文章
在 Monotouch 中更改“返回”NavigationItem 文本?