
OC
码农天后
公众号:Yong代码改变世界
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
CollectionView,scrollToItemAtIndexPath方法失效
NSIndexPath *indexPath = [NSIndexPath indexPathWithIndex:2]; [self.collectionView scrollToItemAtIndexPath:path atScrollPosition:(UICollectionViewScrollPositionCenteredHorizontally) animated:NO];原创 2021-03-11 15:01:53 · 888 阅读 · 0 评论 -
The following Swift pods cannot yet be integrated as static libraries:
[!] The following Swift pods cannot yet be integrated as static libraries:The Swift pod `Moya` depends upon `RxAtomic`, which do not define modules. To opt into those targets generating module ma...原创 2019-04-26 15:11:01 · 5051 阅读 · 1 评论 -
tableView由于设置动态高度造成的死循环,最后奔溃
只需要在你的项目中把estimatedHeightForRowAtIndexPath方法写实现以下,返回一个估计高度(随便估,建议还是按照正常思路来写,大概高度是多少就返回多少),这样就不会报EXC_BAD_ACCESS错误了.注意:estimatedHeightForRowAtIndexPath方法既是下面这个方法.- (CGFloat)tableView:(UITableView *...原创 2019-04-26 15:07:37 · 525 阅读 · 0 评论 -
tableView属性
初始化方法:initWithFrame:-----------设置表的大小和位置initWithFrame:style---------设置表的大小,位置和样式(style : Grouped/Plain)dataSource ---设置UITableViewDataSource的代理delegate ---设置UItableViewDelegate的代理sectionHead...原创 2018-11-09 11:16:09 · 961 阅读 · 0 评论 -
iOS webView添加网络css和网络html
依博客的css为例(https://csdnimg.cn/release/phoenix/template/css/ck_htmledit_views-e4c7a3727d.css)创建webVIew- (UIWebView *)webView{ if (!_ webView) { _ webView = [UIWebView new]; ...原创 2018-10-12 15:15:52 · 1483 阅读 · 0 评论 -
UIImageView添加SVG格式的图片
pod 导入pod 'SVGKit'pod 'CocoaLumberjack' 创建UIImage的分类.h 文件中/**@param name svg name xxx.svg@param size image size@return svg image*/+(UIImage *)svgImgNamed:(NSString *)name siz...原创 2018-09-07 14:32:57 · 4048 阅读 · 0 评论 -
识别图片中的二维码
- (void)qrScan:(UIImage *)image{ CIImage *ciImage = [[CIImage alloc] initWithCGImage:image.CGImage options:nil]; CIContext *context = [CIContext contextWithOptions:@{kCIContextUseSoftwareRen...原创 2018-07-31 15:40:30 · 4683 阅读 · 1 评论 -
iOS中在系统相册中创建自己App的自定义相册
//name 创建相册的名字+(void)createAssetCollectionName:(NSString *)name{ [[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{ // 调用判断是否已有该名称相册 PHAssetCollection *assetCollection = [...原创 2018-07-27 16:51:26 · 1869 阅读 · 1 评论 -
根据image得到asset
+ (void)getAssetWithImage:(UIImage *)image getAssetSuccess:(void(^)(PHAsset *asset))getSuccess{ __block NSString *assetId = nil; [[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{ ...原创 2018-07-27 16:45:49 · 1306 阅读 · 1 评论 -
iOS模拟定位
1.创建一个FakeGPS工程2.command +n 创建一个GPX File的location.pgx文件3.product -->Scheme --> edit scheme -->options --->default location 4.选中location5.修改你想要的经纬度即可...原创 2018-03-15 10:57:29 · 6471 阅读 · 1 评论 -
解决Controller臃肿问题
思路:controller里面就只应该存放这些不能复用的代码,这些代码1.初始化时,构造相应的view和model.2.监听model层的事件,将model层的数据传递到view.3.监听view层的事件,并且将view层的事件转发到model成.controller只有以上这些代码它的逻辑就非常简单了,而且非常短.controller进一步的解决方案但是,我们却很难做到这一点,因为还是有很多逻辑...原创 2018-02-28 16:00:03 · 1252 阅读 · 0 评论 -
iOS拖到工程里的图片 、MP3 文件获取为空
拖到工程里的图片或文件获取不到 查看是否勾选 不选是读不到文件的 或者把图片放在这里边吧,不管是.jpg还是.png的都可以想要了解更多请关注公众号原创 2017-09-22 13:36:11 · 1385 阅读 · 0 评论 -
根据进度条的颜色设置进度条上字体的颜色
UIView *view = [[UIView alloc]initWithFrame:CGRectMake(10, 300, 300, 40)]; view.backgroundColor = [UIColor whiteColor]; [self.view addSubview:view]; UILabel *label = [[UILabel al原创 2017-10-11 16:02:08 · 3068 阅读 · 0 评论 -
UIView固定一个角进行缩放
#define SCREENW [UIScreen mainScreen].bounds.size.width#define SCREENH [UIScreen mainScreen].bounds.size.height#define XY SCREENW/414 self.timeLB = [[UILabel alloc]initWithFrame:CGRectMake(-50,-20,原创 2017-10-20 16:58:25 · 1949 阅读 · 0 评论 -
iOS 网络请求的Url(音频视频的URL)本地存储
/存储 dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ NSString *ad_voice =@"http://fdfs.xmcdn.com/group11/M00/AD/5F/wKgDa1ZfFi-gRNYMABuxsyS4ea4688.mp原创 2017-11-03 10:35:39 · 2938 阅读 · 0 评论 -
AFNetWorking下载网络音乐视频或者图片
healp.h#import @interface Healp : NSObjecttypedef void(^filePath)(NSString *data);+(void)downLoadUrlString:(NSString *)urlStr returnStr:(filePath)str;@endhealp.m#import "Healp.h"原创 2017-11-03 18:38:51 · 1453 阅读 · 0 评论 -
新年到了一起拆红包吧
- (void)viewDidLoad { [superviewDidLoad]; UIView *view1 = [[UIViewalloc]init]; [self.viewaddSubview:view1]; view1.frame = CGRectMake(100, 400, 100, 100) ; view1原创 2018-01-30 17:38:28 · 349 阅读 · 0 评论 -
iOS设置圆角和投影效果 解决设置了圆角投影效果设置不上问题
//一般大家都会这样设置 你会发现投影效果并没有呈现出来 UIView *samall = [[UIViewalloc]initWithFrame:CGRectMake(100,350, 100,100)]; samall.backgroundColor = [UIColorredColor]; samall.layer.cornerRad原创 2017-09-07 15:59:57 · 2958 阅读 · 0 评论 -
UIAlertController设置行间距 字体颜色
UIAlertController *alertController=[UIAlertController alertControllerWithTitle:title message:message preferredStyle:preferredStyle]; //设置行间距 NSMutableParagraphStyle *paragraphStyle = [[NSMutabl原创 2017-08-25 13:55:04 · 980 阅读 · 1 评论