1. StoryBoard中scrollview不能滑動
解決方法:在如下方法中定義contentsize
-(void)viewDidLayoutSubviews
{
self.scrollView.contentSize = CGSizeMake(712,1000);
}
2. 項目只支持豎屏
解決辦法:?在General->Device Orientation里只勾選了portrait, 取消勾選其他的
3.改變導航欄title的顏色
[self.navigationController.navigationBarsetTitleTextAttributes:[NSDictionarydictionaryWithObjectsAndKeys:[UIColorwhiteColor],NSForegroundColorAttributeName,nil]];
4.自定義導航欄的title
UILabel* titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(0,0,100,44)];
titleLabel.backgroundColor= [UIColorclearColor];//設置Label背景透明
titleLabel.font= [UIFontboldSystemFontOfSize:24];//設置文本字體與大小
titleLabel.textColor= [UIColorwhiteColor];//設置文本顏色
titleLabel.baselineAdjustment=UIBaselineAdjustmentAlignCenters;//設置居中
titleLabel.text=@"通知";//設置標題
self.navigationItem.titleView = titleLabel;
5.狀態欄字體顏色的設置
在info.plist文件里面 添加View controller–based status bar appearance 并設置為NO
在UIViewController里的viewWillApper或viewDidAppear里面加入[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
6.tableView上面多出來的那一部分
self.automaticallyAdjustsScrollViewInsets=false
7.tableView不想讓多余的cell顯示出來
self.tableView.tableFooterView= [[UIViewalloc]initWithFrame:CGRectZero];
8.tabBar的圖片默認會被渲染, 得到不被渲染的效果
self.tabBarController.tabBar.selectedItem.selectedImage = [[UIImage imageNamed:@"TabBar_Discovery_Sel"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];