[RedRain筆記](méi) -iOS功能點(diǎn)收集

  • 修改UITextField中Placeholder的文字顏色
[text setValue:[UIColor redColor] forKeyPath:@"_placeholderLabel.textColor"];

  • 修改Label中不同文字顏色
- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    [self editStringColor:self.label.text editStr:@"好" color:[UIColor blueColor]];
}

- (void)editStringColor:(NSString *)string editStr:(NSString *)editStr color:(UIColor *)color {
    // string為整體字符串, editStr為需要修改的字符串
    NSRange range = [string rangeOfString:editStr];

    NSMutableAttributedString *attribute = [[NSMutableAttributedString alloc] initWithString:string];

    // 設(shè)置屬性修改字體顏色UIColor與大小UIFont
    [attribute addAttributes:@{NSForegroundColorAttributeName:color} range:range];

    self.label.attributedText = attribute;
}

  • layoutSubviews調(diào)用的調(diào)用時(shí)機(jī)
* 當(dāng)視圖第一次顯示的時(shí)候會(huì)被調(diào)用
* 當(dāng)這個(gè)視圖顯示到屏幕上了,點(diǎn)擊按鈕
* 添加子視圖也會(huì)調(diào)用這個(gè)方法
* 當(dāng)本視圖的大小發(fā)生改變的時(shí)候是會(huì)調(diào)用的
* 當(dāng)子視圖的frame發(fā)生改變的時(shí)候是會(huì)調(diào)用的
* 當(dāng)刪除子視圖的時(shí)候是會(huì)調(diào)用的


  • 打印View所有子視圖
po [[self view]recursiveDescription]

  • Setting Bundle(編輯設(shè)置頁(yè)面)
http://blog.csdn.net/nogodoss/article/details/21938771

  • IOS 后臺(tái)掛起程序 當(dāng)程序到后臺(tái)后,繼續(xù)完成Long-Running Task 任務(wù)
http://sishuok.com/forum/blogPost/list/8393.html

  • 設(shè)置Label的行間距
-(void)test{
    NSMutableAttributedString *attributedString =    
   [[NSMutableAttributedString alloc] initWithString:self.contentLabel.text];
    NSMutableParagraphStyle *paragraphStyle =  [[NSMutableParagraphStyle alloc] init];  
   [paragraphStyle setLineSpacing:3];

    //調(diào)整行間距       
   [attributedString addAttribute:NSParagraphStyleAttributeName 
                         value:paragraphStyle 
                         range:NSMakeRange(0, [self.contentLabel.text length])];
     self.contentLabel.attributedText = attributedString;
}

  • iOS 開(kāi)發(fā)中一些相關(guān)的路徑
模擬器的位置:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs 

文檔安裝位置:
/Applications/Xcode.app/Contents/Developer/Documentation/DocSets

插件保存路徑:
~/Library/ApplicationSupport/Developer/Shared/Xcode/Plug-ins

自定義代碼段的保存路徑:
~/Library/Developer/Xcode/UserData/CodeSnippets/ 
如果找不到CodeSnippets文件夾,可以自己新建一個(gè)CodeSnippets文件夾。

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

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

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