- 修改UITextField中Placeholder的文字颜色
[text setValue:[UIColor redColor] forKeyPath:@"_placeholderLabel.textColor"];
- (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];
// 设置属性修改字体颜色UIColor与大小UIFont
[attribute addAttributes:@{NSForegroundColorAttributeName:color} range:range];
self.label.attributedText = attribute;
}
* 当视图第一次显示的时候会被调用
* 当这个视图显示到屏幕上了,点击按钮
* 添加子视图也会调用这个方法
* 当本视图的大小发生改变的时候是会调用的
* 当子视图的frame发生改变的时候是会调用的
* 当删除子视图的时候是会调用的
po [[self view]recursiveDescription]
http://blog.csdn.net/nogodoss/article/details/21938771
- IOS 后台挂起程序 当程序到后台后,继续完成Long-Running Task 任务
http://sishuok.com/forum/blogPost/list/8393.html
-(void)test{
NSMutableAttributedString *attributedString =
[[NSMutableAttributedString alloc] initWithString:self.contentLabel.text];
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
[paragraphStyle setLineSpacing:3];
//调整行间距
[attributedString addAttribute:NSParagraphStyleAttributeName
value:paragraphStyle
range:NSMakeRange(0, [self.contentLabel.text length])];
self.contentLabel.attributedText = attributedString;
}
模拟器的位置:
/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文件夹,可以自己新建一个CodeSnippets文件夹。
证书路径
~/Library/MobileDevice/Provisioning Profiles
网友评论