- 博客(7)
- 收藏
- 关注
原创 iOS 自动布局报错:Unable to simultaneously satisfy constraints.
这种错误,一般就两个原因:1,约束设置错误,或者约束设置重复,这一种把约束全部删除掉再重新添加约束。2,忘记设置控件的:setTranslatesAutoresizingMaskIntoConstraints等于NO 。
2017-01-11 15:47:33 1479
原创 iOS UITextField限制输入长度
#pragma mark - 限制输入长度- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{ if (textField ==self.textField) {
2017-01-11 14:39:09 355
转载 iOS 解决警告“ld: warning: directory not found for option”
从项目中删除了某个目录、文件以后,编译出现警告信息:ld: warning: directory not found for option“XXXXXX”去掉警告的办法如下:1选择工程, 编译的 (targets)2选择 Build Settings 菜单3查找 Library Search Paths 和 Framewo
2017-01-11 11:45:45 620
原创 iOS 在NSObject的子类中使用UIAlertController
UIAlertController * alert = [UIAlertController alertControllerWithTitle:@"温馨提示" message:@"打开" preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction * cancelAction = [UIAlertAction act
2017-01-05 15:44:43 1686
原创 iOS 中文转UTF-8编码
NSString * str = @"竞技场时间"; //第一种方法 str = [str stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];//编码带汉字的url //第
2017-01-05 15:10:20 1827
转载 iOS 开发经验总结
在iOS开发中经常需要使用的或不常用的知识点的总结,几年的收藏和积累(踩过的坑)。一、 iPhone Size手机型号屏幕尺寸iPhone 4 4s320 * 480iPhone 5 5s320 * 568iPhone 6 6s375 * 667iphone 6 pl
2017-01-05 14:52:16 422
原创 iOS UILabel自适应宽度
UILabel * label = [[UILabelalloc]initWithFrame:CGRectMake(100,100, 80,20)]; label.backgroundColor = [UIColor whiteColor]; label.textColor = [UIColor blackColor]; label
2017-01-05 14:47:29 6532
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人