iOS開發(fā)問題紀(jì)錄

1.UIStatusBar 顏色變白

plist里設(shè)置兩項

1.Status bar style = UIStatusBarStyleLightContent

2. View controller-based status bar appearance ?= ?NO

ddd

怎么改變狀態(tài)欄的顏色

2.iOS7 UITabBar自定義選中圖片顯示為默認(rèn)藍(lán)色的Bug

UIImage* image =[UIImageimageNamed:@"tab-tip2"];

image = [imageimageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

self.tabBarItem.selectedImage= image;

另外一種設(shè)置[背景色,圖片色,文字色]


3.如何判斷一個類是否支持某屬性和方法以及如何判斷IOS的版本

instancesRespondToSelector

respondsToSelector

4.storyboard里的viewcontroller里view上拖進去的控件運行起來看不到

storyboard在設(shè)置為 wCompact 和hCompact時對控件的顯示需要在 屬性面板中的installed勾選上

5.attributedString屬性

NSDictionary*underlineAttribute=@{NSUnderlineStyleAttributeName:@(NSUnderlineStyleSingle)};

myLabel.attributedText=[[NSAttributedStringalloc]initWithString:@"Test string"attributes:underlineAttribute];



6.自定義導(dǎo)航條按鈕并系統(tǒng)返回手姿 以及 導(dǎo)航條按鈕顏色 設(shè)置

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. 改變標(biāo)簽欄橫線顏色


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.改變導(dǎo)航條橫線顏色

//給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;

}

//調(diào)用

[[UINavigationBar appearance] setShadowImage:[UIImage imageWithColor:tabBar_line size:CGSizeMake(kDeviceWidth, 1)]];

iOS 關(guān)于1900時間字符串轉(zhuǎn)Date類型的問題記錄

?UIAlertView 鍵盤問題

uialertview 彈出是有鍵盤處理,需要在uialertview之前處理鍵盤問題,不然確定后會閃跳鍵盤

UITabbar上的黑線去除

導(dǎo)航控制器第一個頁面沒有導(dǎo)航條的情況如何處理返回情況

導(dǎo)航條控制器操作按鈕點擊范圍過大問題修復(fù)

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容