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

    iOS对象实例化

    实例化TableCell 在设置delegate之前注册xib Swift self.tableView.registerNib(UINib.init(nibName: "ImageLabelTableViewCell ", bundle: nil), forCellReuseIdentifier: "ImageLabelTableViewCell"); Swift3 self.tableView.register(UINib.init IndexTableViewCell", bundle: nil), forCellReuseIdentifier: "IndexTableViewCell"); OC [self.tableView registerNib:[UINib RenwuMyViewController" bundle:nil]; 实例化UICollectionCell 在设置delegate之前注册xib Swift self.collectionView.registerNib(UINib.init MyCell", bundle: nil), forCellWithReuseIdentifier: "MyCell"); Objc [self.collectionView registerNib:[UINib

    2.2K20发布于 2019-10-22
  • 来自专栏日常技术分享

    Swift:UICollectionReusableView xib创建报错

    SubscribeFooter.self, ofKind: UICollectionView.elementKindSectionFooter) 我换成原生的注册 collectionView.register(UINib UICollectionView.elementKindSectionHeader, withReuseIdentifier: "SubscribeHeader") collectionView.register(UINib

    1.1K10发布于 2020-08-24
  • 来自专栏码客

    iOS UICollectionView的用法

    UICollectionViewDataSource,UICollectionViewDelegateFlowLayout 设置 Swift self.collectionView.register(UINib.init nonatomic) NSMutableArray<NSMutableArray<OrderPicModel *> *> *tableData; [self.collectionView registerNib:[UINib super.awakeFromNib() // Initialization code } } 注册 self.collectionView.registerNib(UINib right3Y, itemWidth, itemHeight2) } return attribute } } 设置 collectionView.registerNib(UINib.init MainBigCollectionViewCell", bundle: nil), forCellWithReuseIdentifier: "mainBigCollCell"); collectionView.registerNib(UINib.init

    1.8K20发布于 2019-10-22
  • 来自专栏梧雨北辰的开发录

    使用xib自定义UIcollectionViewCell控件为nil的问题

    其实这是一个很简单的过程,关键代码也就包括下面的两部分: //注册集合视图单元格 UINib *nib = [UINib nibWithNibName:@"MyCollectionCell"

    1.7K50发布于 2018-04-24
  • 来自专栏iOSDevLog

    《iOS UI 开发捷径 利用 Interface Builder 高效、优雅地开发 UI》 读书笔记第1章 Interface Bundle 概要第2章 使用 Interface Builder第3

    既可以与 UIView 关联,也可以与 UIViewController 关联,也可以同时关联 UIView 与 UIViewController 使用 xib 通过 Bundle 方式加载 通过 UINib UIView view.addSubview(testView) UINib NS_CLASS_AVAILABLE_IOS(4_0) @interface UINib : NSObject // If in response to memory pressure (e.g. memory warning), reloading from the bundle when necessary. + (UINib = nil) -> [Any] } UINib Demo let testViewNib = UINib.init(nibName: "TestView", bundle: Bundle.main) func loadTestView() { let testView = UINib.instantiate(withOwner: nil, options: nil)[0] as!

    3.1K80发布于 2018-05-17
  • 来自专栏向治洪

    高仿ios斗鱼界面

    collectionView.autoresizingMask = [.flexibleHeight, .flexibleWidth] collectionView.register(UINib CollectionNormalCell", bundle: nil), forCellWithReuseIdentifier: NormalCellID) collectionView.register(UINib CollectionPrettyCell", bundle: nil), forCellWithReuseIdentifier: PrettyCellID) collectionView.register(UINib

    1.4K50发布于 2018-02-06
  • 来自专栏全栈程序员必看

    Swift 书面 ToDo App

    var bundle: NSBundle = NSBundle.mainBundle() var nib: UINib = UINib(nibName: "Cell", bundle: bundle func registerCell() { var bundle: NSBundle = NSBundle.mainBundle() var nib: UINib = UINib(nibName: "Cell", bundle: bundle) tableView.registerNib(nib, forCellReuseIdentifier:

    2.4K20编辑于 2022-07-06
  • 来自专栏向治洪

    ios仿斗鱼界面

    collectionView.autoresizingMask = [.flexibleHeight, .flexibleWidth] collectionView.register(UINib CollectionNormalCell", bundle: nil), forCellWithReuseIdentifier: NormalCellID) collectionView.register(UINib CollectionPrettyCell", bundle: nil), forCellWithReuseIdentifier: PrettyCellID) collectionView.register(UINib

    1.6K90发布于 2018-01-26
  • 来自专栏ShaoYL

    自定义View

    NSString * 是 xib 文件名 * NSBundle * 传入 mainBundle * 如果传入参数是 mainBundle 则可以传入 nil * */ UINib *nib = [UINib nibWithNibName:<#(NSString *)#> bundle:<#(NSBundle *)#>] xib 和 storyboard 对比 共同点 都用来描述软件界面

    96760发布于 2018-05-11
  • 来自专栏浮躁的喧嚣

    iOS-关于加载xib

    mainBundle]loadNibNamed:NSStringFromClass(self) owner:nil options:nil] ; return xibArray[0]; 第二种加载方式 UINib *nib = [UINib nibWithNibName:NSStringFromClass(self) bundle:nil]; NSArray *xibArray = [nib instantiateWithOwner

    69110编辑于 2023-11-22
  • 来自专栏编程语言

    Swift:UICollectionReusableView xib创建 报错

    details/102794333 Xcode11 版本,通过xib创建UICollectionReusableView,存在无法获取xib文件问题 使用流程: 注册xib let nibfoot = UINib.init

    1K30发布于 2019-10-30
  • 来自专栏日常技术分享

    Swift Reusable开源库使用

    MyCustomCell: UITableViewCell, Reusable { } 接着在tableview或者collectionView中register tableView.register(UINib.init

    1.5K10发布于 2020-08-20
  • 来自专栏青玉伏案

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

    8 UINib *headerNib = [UINib nibWithNibName: @"CollectionHeaderReusableView" 9 withReuseIdentifier: @"CollectionHeaderReusableView"]; 15 16 17 //注册FooterView 18 UINib *footerNib = [UINib nibWithNibName: @"CollectionFooterReusableView" 19

    2.2K80发布于 2018-01-11
  • 来自专栏大话swift

    制作动态framework与静态framework的那些坑

    imageWithContentsOfFile:[dyBundle pathForResource:@"test" ofType:@"png"]]; [self.tableView registerNib:[UINib EmbededFramework.framework/EmViewController" bundle:[NSBundle mainBundle]]; [self.tableView registerNib:[UINib

    2.5K20发布于 2020-05-08
  • 来自专栏TechBox

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

    UINib *headerNib = [UINib nibWithNibName: @"CollectionHeaderReusableView" withReuseIdentifier: @"CollectionHeaderReusableView"]; //注册FooterView UINib *footerNib = [UINib nibWithNibName: @"CollectionFooterReusableView"

    8.4K40发布于 2018-06-05
  • 来自专栏学海无涯

    iOS开发之UICollectionViewDataSourcePrefetching

    = self; collection.delegate = self; collection.prefetchDataSource = self; //注册Cell UINib *nib = [UINib nibWithNibName:@"ImgCollectionViewCell" bundle:nil]; [collection registerNib:nib forCellWithReuseIdentifier

    2.6K60发布于 2018-05-03
  • 来自专栏青玉伏案

    iOS开发之多表视图滑动切换示例(仿"头条"客户端)

    nibsRegistered) { 19 UINib *nib=[UINib nibWithNibName:@"SlideBarCell" bundle:nil]; 20

    4.3K60发布于 2018-01-11
  • 来自专栏技术之路

    【swift学习笔记】三.使用xib自定义UITableViewCell

    let cellNib = UINib(nibName: "carTblCell", bundle: nil) tableView.registerNib(cellNib, forCellReuseIdentifier

    2.5K70发布于 2018-01-31
  • 来自专栏非典型技术宅

    两种通过Plist加载图片的方法及问题,九宫格的算法,字典转模型1. 序列帧动画实现2. 图片浏览器-两种加载plist的方式3. 图片浏览器-内存问题4 MVC简单介绍和类前缀5 应用管理-两种加载

    做了内存优化"如果内存紧张"内存警告,可以自动释放,如果有需要会重新自动加载"" //第一个参数:XIB的名字 //第二个参数:Bundle 名,如果传入 nil,会自动从 mainBundle 获取 UINib *nib = [UINib nibWithNibName:@"CZAppView" bundle:nil]; //第一个、第二个参数,老师没有讲,说自己从来没有用过。

    1.4K30发布于 2018-06-28
  • 来自专栏韦弦的偶尔分享

    通过 XIB 自定义 View 的便捷加载方法

    /// 注册 xib cell func register<T: UITableViewCell>(nib cellType: T.Type) { register(UINib

    1.4K20发布于 2021-11-24
领券