首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏大宇笔记

    CollectionView stortBoard headview bug

    问题点: 1.不显示问题  2.拖不出xib上的控件做属性 报错信息如下: outlets connot  be connected to repeating content 原因及解决办法: 1.因为collectionView 的headerView也有复用机制,所以需要实现复用代理方法 解决如下: - (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath - (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind

    56220发布于 2019-01-15
  • 来自专栏TechBox

    (转)iOS开发之UICollectionViewController系列(二) :详解CollectionView各种回调

    : (UICollectionView *)collectionView numberOfItemsInSection: (NSInteger)section { return Objective-C /** * Section中每个Cell的上下边距 */ - (CGFloat)collectionView: (UICollectionView *)collectionView Objective-C /** * Section中每个Cell的左右边距 */ - (CGFloat)collectionView: (UICollectionView *)collectionView Objective-C /** * headerView的大小 */ - (CGSize)collectionView: (UICollectionView *)collectionView Objective-C /** * Cell多选时是否支持取消功能 */ - (BOOL)collectionView:(UICollectionView *)collectionView

    8.4K40发布于 2018-06-05
  • 来自专栏林德熙的博客

    WPF 已知问题 清空 CollectionView 的 SortDescriptions 可能抛出空异常

    本文记录一个 WPF 的已知问题,在通过 CollectionViewSource 获取到 CollectionView 之后,如果 CollectionViewSource 对象已被 GC 回收,将可能在调用 类型的一个对象,将 CollectionView 存放到字段里面。 = collectionViewSource.View; _collectionView = collectionView; collectionView.SortDescriptions.Add System.Windows.Data.CollectionView.RefreshInternal() PresentationFramework.dll! System.Windows.Data.CollectionView.RefreshOrDefer() PresentationFramework.dll!

    1K20编辑于 2023-04-07
  • 来自专栏青玉伏案

    iOS开发之窥探UICollectionViewController(二) --详解CollectionView各种回调

    1 /** 2 * Section中每个Cell的上下边距 3 */ 4 - (CGFloat)collectionView: (UICollectionView *)collectionView 1 /** 2 * Section中每个Cell的左右边距 3 */ 4 - (CGFloat)collectionView: (UICollectionView *)collectionView 1 /** 2 * headerView的大小 3 */ 4 - (CGSize)collectionView: (UICollectionView *)collectionView 5 1 /** 2 * 如果Cell可以高亮,Cell变为高亮后调用该方法 3 */ 4 - (void)collectionView: (UICollectionView *)collectionView 1 /** 2 * Cell多选时是否支持取消功能 3 */ 4 - (BOOL)collectionView:(UICollectionView *)collectionView shouldDeselectItemAtIndexPath

    2.1K80发布于 2018-01-11
  • 来自专栏非典型技术宅

    Swift多线程之Operation:异步加载CollectionView图片1. Operation 设置依赖关系2. 前置知识点内容3. CollectionView中图片进行异步加载

    然后就是一道相对丰盛的大菜,使用Operation在CollectionView上实现子线程加载图片的案例。这个例子其实在生产中经常可以碰见。先把界面加载出来,然后再慢慢往item里面加载图片。 下面是最终实现的CollectionView异步加载图片的例子效果: ? collectionDemo.gif 1. Operation 设置依赖关系 高楼大厦从地起,我们就从今天餐前小点开始。 activityIndicator.stopAnimating() } } } 好啦,接下来看看写那个异步加载CollectionView图片怎么搞。 CollectionView中图片进行异步加载 来看一下思维导图: ? image.png 源代码各位可以自行下载观看,只有Swift版本的下载 。 给item赋值图片的重点地方的代码: override func collectionView(_ collectionView: UICollectionView, willDisplay cell:

    1.8K70发布于 2018-06-28
  • 来自专栏大师级码师

    UICollectionView 的使用详解

    =self; self.collectionView.delegate=self; [self.collectionView setBackgroundColor:[UIColor clearColor //定义展示的UICollectionViewCell的个数 -(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection { return 2; } //每个UICollectionView展示的内容 -(UICollectionViewCell )collectionView:(UICollectionView ) collectionView cellForItemAtIndexPath:(NSIndexPath )indexPath { static NSString CellIdentifier = @ :(UICollectionView )collectionView shouldSelectItemAtIndexPath:(NSIndexPath )indexPath { return YES

    1.2K00发布于 2021-10-31
  • 来自专栏青玉伏案

    iOS开发之资讯类App常用分类控件的封装与实现(CollectionView+Swift3.0+)

    在之前的博客中,我们系列的介绍了UICollectionView的各种回调,以及如何自定义CollectionView的布局,并给出了如何使用CollectionView自定义瀑布流。 下方就是我们所封装控件的调用方式,下方的二维数组dataSource就是我们所封装控件中的CollectionView中的数据源,该数据源中的数据项要遵循我们指定的CEThemeDataSourceProtocal 说吧了,就是长按手势识别以及CollectionView的Cell的移动。下方我们将详细的介绍一下该控件的核心代码的实现。 1. 2、为CollectionView添加长按手势 接下来要做的就是给CollectionView添加LongPressGestureRecognize。 addGestureRecognizer()方法负责为我们的CollectionView添加长按手势,longPress()方法就是该长按手势所触发的方法。

    2.1K50发布于 2018-01-11
  • 来自专栏编程之路

    Swift纯代码 UICollectionView 分组显示、Cell圆角、选中变色

    //注册header collectionView!. //设置HeadView的宽高 func collectionView(collectionView: UICollectionView, layout collectionViewLayout func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath delegate = self; collectionView?.dataSource = self; collectionView?. //注册header collectionView!.

    5.6K10发布于 2018-08-30
  • 来自专栏iOS逆向与安全

    iOS UICollectionView 从右向左对齐的实现

    reloadData]; } - (UICollectionView *)collectionView { if (_collectionView == nil) { UICollectionViewFlowLayout = [UIColor whiteColor]; _collectionView.showsVerticalScrollIndicator = NO; _collectionView.bounces = NO; _collectionView.dataSource = self; _collectionView.delegate = self; { return 1; } - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection )); return size; } - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView

    3.2K40发布于 2021-07-29
  • 来自专栏iOS小生活

    UICollectionView

    *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath; - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath :(NSIndexPath *)indexPath; - (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:( :(NSInteger)section; - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout :(NSInteger)section; - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout

    1.6K20发布于 2019-08-12
  • 来自专栏進无尽的文章

    UI篇-UICollectionView 补充

    没有注册这个 设置区头高度 -(CGSize)collectionView:(UICollectionView )collectionView layout:(UICollectionViewLayout 可以在VC中具体实现对应的方法: 定义每个Section的约束,具体作用是靠近左右边缘的距离,这里定义的上下距离约束会被其他协议覆盖掉 -(UIEdgeInsets)collectionView:( **:(NSInteger)section{ CGSize size={5*NEWX,5*NEWX}; return size; } 设置元素大小 -(CGSize)collectionView 上的数据都是取自于它所以,此处应该把数据源也随着移动更新下 - (void)collectionView:(UICollectionView *)collectionView moveItemAtIndexPath ]; break; } } ---- //设置元素大小 -(CGSize)collectionView:(UICollectionView *)collectionView layout

    2.1K20发布于 2018-09-12
  • 来自专栏iOS 开发

    UICollectionView 连续插入分区刷新问题

    ({ self.collectionView.insertSections(IndexSet(integer: section)) self.collectionView.insertItems(at: insertIndexPathMap) }) { (finish) in () } 11Pro 以上手机必须加入 真他妈的坑 self.collectionView.layoutIfNeeded() ({ self.collectionView.insertSections(IndexSet(integer: section)) () self.collectionView.layoutIfNeeded() }

    1K20发布于 2021-03-05
  • 来自专栏向治洪

    高仿ios斗鱼界面

    = UIColor.white collectionView.dataSource = self collectionView.delegate = self collectionView.autoresizingMask = [.flexibleHeight, .flexibleWidth] collectionView.register [section].anchors.count } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = collectionView.dequeueReusableCell (menuView) collectionView.contentInset = UIEdgeInsets(top: kMenuViewH, left: 0, bottom: 0,

    1.3K50发布于 2018-02-06
  • 来自专栏一“技”之长

    iOS流布局UICollectionView系列七——三维中的球型布局

    {     return 1; } //我们返回30的标签 -(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection :(NSInteger)section{     return 30; } -(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView *([self.collectionView numberOfItemsInSection:0]+2), self.collectionView.frame.size.height*([self.collectionView , self.collectionView.frame.size.height/2+self.collectionView.contentOffset.y);     atti.size = CGSizeMake /self.collectionView.frame.size.height;     float angleOffsetx = offsetx/self.collectionView.frame.size.width

    1.8K20发布于 2018-08-16
  • 来自专栏码客

    iOS UICollectionView的用法

    = false; self.collectionView.showsVerticalScrollIndicator = false; self.collectionView.backgroundColor = flowLayout; self.collectionView.dataSource = self; self.collectionView.delegate = self; ---- OC @property = false; self.collectionView.showsVerticalScrollIndicator = false; self.collectionView.scrollEnabled = flowLayout; self.collectionView.dataSource = self; self.collectionView.delegate = self; 代理方法 Swift (collectionView: UICollectionView) -> Int { return 1; } func collectionView(collectionView:

    1.8K20发布于 2019-10-22
  • 来自专栏码客

    iOS 引导页实现方式

    = false; self.collectionView.showsVerticalScrollIndicator = false; self.collectionView.backgroundColor = flowLayout; self.collectionView.isPagingEnabled = true; self.collectionView.dataSource = self : UICollectionView) -> Int { return 1; } func collectionView(_ collectionView: UICollectionView indexPath: IndexPath) -> CGSize { return CGSize(width: self.collectionView.frame.width, height: self.collectionView.frame.height); } func collectionView(_ collectionView: UICollectionView, didSelectItemAt

    1.7K10发布于 2019-10-22
  • 来自专栏西二旗一哥

    Some problems with refresh UICollectionView

    May flash on the screen Sometiems you may find your collectionView has a phenomenon of flash when you You may call layoutSubViews manually as followed: //BUG: [self.collectionView reloadData]; //Solution : [self.collectionView reloadData]; [self.collectionView setNeedsLayout]; [self.collectionView performBatchUpdates:^{ [collectionView reloadItemsAtIndexPaths:indexPaths]; } completion:^(BOOL performBatchUpdates:^{ [collectionView reloadItemsAtIndexPaths:indexPaths]; } completion

    2.3K30发布于 2018-09-30
  • 来自专栏青玉伏案

    iOS开发之窥探UICollectionViewController(五) --一款炫酷的图片浏览组件

    自定义的CollectionView可谓是非常灵活,其灵活性也决定了其功能的强大。CollectionView的自定义就是其Cell高度可定制的属性,通过对Cell赋值不同的属性来达到自定义的目的。 本篇博客是使用自定义CollectionView的另一个实例,自定义CollectionView的方式和上一篇是一致的,都是重写UICollectionViewLayout相应的方法,然后再通过委托回调来设置布局的参数 自定义CollectionView的思路是一样的,只是具体的实现方式不同。学习么,要学会举一反三,希望大家能通过这两篇自定义CollectionView的博客来写出属于你自己的自定义效果。 其实所有CollectionView的自定义布局的使用方式都是一样的,分为以下几步: 1.为我们的CollectionView指定该布局,本篇博客的CollectionView是通过Storyboard 其中transform的值是根据CollectionView的滚动偏移量来计算的,所以在滚动CollectionView时,Cell也会跟着旋转。

    1.8K80发布于 2018-01-11
  • 来自专栏移动端开发

    给UICollectionView设置组背景和组圆角-Swift

    delegate = self.collectionView?. .collectionView?(self.collectionView! (collectionView: self.collectionView! (collectionView: self.collectionView! (collectionView: self.collectionView!

    4.1K51发布于 2020-06-19
  • 来自专栏sktj

    IOS UICollectionView 图片展示墙

    = UICollectionView(frame:rect, collectionViewLayout:flowLayout) 18 19 collectionView.dataSource = self 20 collectionView.delegate = self 21 collectionView.register(UICollectionViewCell.classForCoder func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section:Int) -> Int { 26 return images.count 27 } 28 29 func collectionView(_ collectionView: UICollectionView, cellForItemAt (_ collectionView: UICollectionView, didSelectItemAt indexPath:IndexPath) { 50 let cell = collectionView.cellForItem

    2.7K40发布于 2019-07-08
领券