当前位置: 首页 > wzjs >正文

wap类网站广告推广有哪些平台

wap类网站,广告推广有哪些平台,用mvc做网站报告,公司网站模块制作支持多分区的动态自适应宽度layout,完善了之前只支持一个分区的布局,这里直接上代码,可以用来在商品sku, 搜索记录,编辑tab等场景的使用,灵活性强,支持代理配置 // // LBNumberCenterEditTabLayout.m// /…

支持多分区的动态自适应宽度layout,完善了之前只支持一个分区的布局,这里直接上代码,可以用来在商品sku, 搜索记录,编辑tab等场景的使用,灵活性强,支持代理配置

//
//  LBNumberCenterEditTabLayout.m//
//  Created by liubo on 26.3.25.//#import <UIKit/UIKit.h>NS_ASSUME_NONNULL_BEGIN@protocol LBNumberCenterEditTabLayout.mDelegate <NSObject>- (CGSize)sizeForItemAtIndexPath:(NSIndexPath *)indexPath;- (CGSize)sizeForHeaderViewAtSection:(NSInteger)section;@end@interface LBNumberCenterEditTabLayout.m : UICollectionViewFlowLayout@property (nonatomic, weak) id <LIVNumberCenterEditTabLayoutDelegate> delegate;@property (nonatomic, assign) CGFloat contentWidth;@endNS_ASSUME_NONNULL_END

//
//  LBNumberCenterEditTabLayout.m
//  
//
//  Created by liubo on 26.3.25.
//#import "LBNumberCenterEditTabLayout.m"@interface LBNumberCenterEditTabLayout.m ()@property (nonatomic, strong) NSMutableArray<UICollectionViewLayoutAttributes *> *layoutAttributesArray;@property (nonatomic, assign) CGSize contentSize;@end@implementation LBNumberCenterEditTabLayout.m- (instancetype)init {if (self = [super init]) {self.layoutAttributesArray = [NSMutableArray new];}return self;
}- (void)prepareLayout {[super prepareLayout];[self updateLayout];
}- (CGSize)collectionViewContentSize {return self.contentSize;
}- (NSArray<UICollectionViewLayoutAttributes *> *)layoutAttributesForElementsInRect:(CGRect)rect {return self.layoutAttributesArray;
}#pragma mark - ---------- update ----------- (void)updateLayout {// 移除旧的布局[self.layoutAttributesArray removeAllObjects];CGFloat currentY = 0;CGFloat x = self.sectionInset.left;// 计算新的布局NSInteger sectionCount = [self.collectionView numberOfSections];for (int i = 0; i < sectionCount; i ++) {CGSize headerSize = CGSizeZero;if (self.delegate && [self.delegate respondsToSelector:@selector(sizeForHeaderViewAtSection:)]) {headerSize = [self.delegate sizeForHeaderViewAtSection:i];}if (!CGSizeEqualToSize(headerSize, CGSizeZero)) {UICollectionViewLayoutAttributes *layoutAttributes = [UICollectionViewLayoutAttributes layoutAttributesForSupplementaryViewOfKind:UICollectionElementKindSectionHeader withIndexPath:[NSIndexPath indexPathForItem:0 inSection:i]];;layoutAttributes.frame = CGRectMake(0, currentY, headerSize.width, headerSize.height);currentY += headerSize.height;[self.layoutAttributesArray addObject:layoutAttributes];}NSInteger count = 0;if ([self.collectionView.dataSource respondsToSelector:@selector(collectionView:numberOfItemsInSection:)]) {count = [self.collectionView.dataSource collectionView:self.collectionView numberOfItemsInSection:0];}CGFloat currentX = x;if (count > 0) {for (int j = 0; j < count; j++) {CGSize cellSize = [self sizeForItemAtIndexPath:[NSIndexPath indexPathForItem:j inSection:i]];CGFloat cellWidth = cellSize.width;CGFloat cellHeight = cellSize.height;// 创建布局属性UICollectionViewLayoutAttributes *layoutAttributes = [UICollectionViewLayoutAttributes layoutAttributesForCellWithIndexPath:[NSIndexPath indexPathForItem:j inSection:i]];layoutAttributes.frame = CGRectMake(currentX, currentY, cellWidth, cellHeight);[self.layoutAttributesArray addObject:layoutAttributes];currentX += (self.minimumInteritemSpacing + cellWidth);// 计算下一个item的x,以及布局更新结束检测if (j != count - 1) {if (currentX + cellWidth + self.minimumInteritemSpacing + self.sectionInset.right > self.contentWidth) {currentX = self.sectionInset.left;currentY += self.minimumLineSpacing + cellHeight;}} else {currentY += cellHeight;}if (i == sectionCount - 1 && j == count - 1) {self.contentSize = CGSizeMake(self.contentWidth, currentY);}}}}
}- (CGSize)sizeForItemAtIndexPath:(NSIndexPath *)index {CGSize size = CGSizeZero;if ([self.delegate respondsToSelector:@selector(sizeForItemAtIndexPath:)]) {size = [self.delegate sizeForItemAtIndexPath:index];}return size;
}@end
http://www.dtcms.com/wzjs/291228.html

相关文章:

  • 用什么做网站简单抖音搜索优化
  • 蒙阴网站优化百度热搜榜今日头条排名
  • vb6做网站pageadmin建站系统
  • 入门网站分析应该怎么做网页设计模板免费网站
  • 省建设干部培训中心网站优化推广网站怎么做最好
  • 做网站文案用哪个软件长沙网络推广外包
  • 微信咋做自己的网站关键词检索怎么弄
  • 泉州城乡建设网站南宁网站推广大全
  • 网站建设服务条款网站优化员seo招聘
  • 网站开发搭建外贸网站推广优化
  • 制作图片视频软件appseo报告
  • 南充网站建设费用建材企业网站推广方案
  • 北京网站制作设计二十条优化措施原文
  • 上海网站推广服务公司如何网上销售自己的产品
  • 网站建设算什么专业北京网络营销咨询公司
  • 买卖平台有哪些网站在线资源搜索引擎
  • 石家庄公司的网站设计b站推广网站2024年
  • 包头网站长沙做优化的公司
  • 做数据的网站软文推广名词解释
  • 南通做网站需要多少钱营销策略的概念
  • 郑州网站建设公司qq郑州seo排名哪有
  • 小说网站排名搜狗链接提交入口
  • 网站客服工作内容广告联盟全自动赚钱系统
  • 如何选择做pc端网站黄金网站软件app大全下载
  • 昆明做网站魄罗科技网站模板哪家好
  • 青岛企业网站模板建站百度问答下载安装
  • 周六日可以在外汇局网站做申报吗百度后台登陆入口
  • 怎么简单做网站排名seo推广技巧
  • 禹州 什么团购网站做的好优化大师怎么删除学生
  • 网站新闻前置备案优化seo方案