1.UIStatusBar 顏色變白
plist里設置兩項
1.Status bar style = UIStatusBarStyleLightContent
2. View controller-based status bar appearance ?= ?NO
怎么改變狀態欄的顏色
2.iOS7 UITabBar自定義選中圖片顯示為默認藍色的Bug
UIImage* image =[UIImageimageNamed:@"tab-tip2"];
image = [imageimageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
self.tabBarItem.selectedImage= image;
另外一種設置[背景色,圖片色,文字色]
3.如何判斷一個類是否支持某屬性和方法以及如何判斷IOS的版本
instancesRespondToSelector
respondsToSelector
4.storyboard里的viewcontroller里view上拖進去的控件運行起來看不到
storyboard在設置為 wCompact 和hCompact時對控件的顯示需要在 屬性面板中的installed勾選上
5.attributedString屬性
NSDictionary*underlineAttribute=@{NSUnderlineStyleAttributeName:@(NSUnderlineStyleSingle)};
myLabel.attributedText=[[NSAttributedStringalloc]initWithString:@"Test string"attributes:underlineAttribute];
6.自定義導航條按鈕并系統返回手姿 以及 導航條按鈕顏色 設置
7.tableviewcell 分割線
viewDidLoad方法和willDisplayCell中加上如下代碼:
if ([self.tableView respondsToSelector:@selector(setSeparatorInset:)]) {
[self.tableView?setSeparatorInset:UIEdgeInsetsZero];
}
if?([self.tableView?????respondsToSelector:@selector(setLayoutMargins:)])?{
[self.tableView?setLayoutMargins:UIEdgeInsetsZero];
}
if([cellrespondsToSelector:@selector(setPreservesSuperviewLayoutMargins:)]) {
[cellsetPreservesSuperviewLayoutMargins:NO];
}
1. 改變標簽欄橫線顏色
NSArray? *tabArray=self.tabBarController.tabBar.subviews;
for ( id obj? in tabArray) {
if ([obj isKindOfClass:[UIImageView class]]) {
UIImageView *imageView=(UIImageView *) obj;
imageView.backgroundColor=View_ToolBar;
}
2.改變導航條橫線顏色
//給imgaeview 添加一個類別
+ (UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size
{
CGRect rect = CGRectMake(0, 0, size.width, size.height);
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context,
color.CGColor);
CGContextFillRect(context, rect);
UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return img;
}
//調用
[[UINavigationBar appearance] setShadowImage:[UIImage imageWithColor:tabBar_line size:CGSizeMake(kDeviceWidth, 1)]];
iOS 關于1900時間字符串轉Date類型的問題記錄
?UIAlertView 鍵盤問題
uialertview 彈出是有鍵盤處理,需要在uialertview之前處理鍵盤問題,不然確定后會閃跳鍵盤