Custom Icon and Image Creation Guidelines:
https://developer.apple.com/library/ios/#documentation/UserExperience/Conceptual/MobileHIG/IconsImages/IconsImages.html
--UILabel
垂直居中
http://tangqiaoboy.blog.163.com/blog/static/1161142582011102010848526/
lab.lineBreakMode = UILineBreakModeWordWrap;
lab.numberOfLines = 0;
lab.adjustsFontSizeToFitWidth = YES;
lab.minimumFontSize = [UIFont systemFontOfSize:8.0];
text.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
// 自适应宽、高
view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
// 自适应宽,固定top margin位置
view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin;
--UISegmentedControl
UISegmentedControl.momentary = YES;不跟踪选中状态
UISegmentedControl.autoresizingMask = UIViewAutoresizingFlexibleWidth;
self.navigationItem.prompt = @" ";
--Button事件关联
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
btn.frame = CGRectMake(0, 0, 320, 55);
[btn addTarget:self action:@selector(eventButton:) forControlEvents:UIControlEventTouchUpInside];
btn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
btn.imageEdgeInsets = UIEdgeInsetsMake(0,0,0,0);
btn.titleEdgeInsets = UIEdgeInsetsMake(0,0,0,0);
contentRectForBound, titleRectForContentRect, imageRectForContentRect
--performSelector
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
tableSelection = indexPath;
tapCount++;
switch (tapCount)
{
case 1: //single tap
[self performSelector:@selector(singleTap) withObject: nil afterDelay: .4];
break;
case 2: //double tap
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(singleTap) object:nil];
[self performSelector:@selector(doubleTap) withObject: nil];
break;
default:
break;
}
}
// 这用得蛮巧的,原理大家都知道,但这么用会少
NSArray * views = [tabBarController.view subviews ];
for(id v in views) {
if([v isKindOfClass:[UITabBar class]]){
[(UITabBar *)v setHidden:YES];}
}