自定义类似微博首页界面(图文混排,优化流畅性,高度封装)
来源:互联网 发布:图案编辑软件 编辑:程序博客网 时间:2024/06/05 03:11
个人邮箱:892569921@qq.com 个人博客:http://blog.csdn.net/cry__boy
QQ技术群:549943887
个人github地址:https://github.com/cryboyofyu
项目地址:github
cocoapods添加:‘XYWeiboCells’
1.方法:
_xyTVController = [[XYTVController alloc]init];
_xyTVController.xy_dataMArr = _xyDataMArr;
_xyTVController.view.frame = CGRectMake(0,64, xy_width, xy_height - 64);
_xyTVController.xy_delegate = self; _xyTVController.xy_numberOfLine = 5;
_xyTVController.tableView.backgroundColor = xy_grayColor; [
self.view addSubview:_xyTVController.tableView];
遵守协议:《XYTVControllerDelegate》
2.对接接口:(头像,cell,图片放大,点赞,转发,评论)
#pragma mark-lv ---------------------代理位置------------------------------
(void)xy_cellSelectedDelegate:(id)sender withIndexPath:(NSIndexPath *)indexPath{ NSLog(@"\n进入了详情页\n"); }
(void)xy_tableViewCellHeadTap:(id)sender withObject:(id)object{ NSLog(@"\n进入了个人页\n"); }
(void)xy_tableViewCellPraiseTap:(id)sender withObject:(id)object{
[[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(xy_praiseButtonClick:) object:object]; [self performSelector:@selector(xy_praiseButtonClick:) withObject:object afterDelay:0.3]; }
(void)xy_praiseButtonClick:(id)sender{
XYTVCell * cell = sender; XYCellFrame * frame;
frame = [_xyTVController.xy_statusFrame objectAtIndex:cell.tag];
[self xy_requestPraiseWithDynamicId:[NSString stringWithFormat:@"%@",frame.xy_cellItem.itemId] withCell:cell];
}
- (void)xy_tableViewCellCommentTap:(id)sender withObject:(id)object { NSLog(@"\n进入详情页\n");
}
- (void)xy_tableViewCellTranspondTap:(id)sender withObject:(id)object{ NSLog(@"\n转发事件触发了\n"); XYTVCell * cell = object;
LVSendStatusVC * lvSendStatusVC = [[LVSendStatusVC alloc]init];
lvSendStatusVC.hidesBottomBarWhenPushed = YES;
lvSendStatusVC.lvTitle = @"转发";
lvSendStatusVC.textViewBgViewH = kLV(85);
lvSendStatusVC.isShowNewsBgView = YES;
lvSendStatusVC.lvItem = cell.lvNewsFrame.lvNewsItem;
if(_categoryView.lvSelectedTag !=1){
[self.navigationController pushViewController:lvSendStatusVC animated:YES]; //
}else{ // [LVHUD showCustomHUDWithBgView:self.view withTitle:@"暂未开通此功能!"]; // } }
(void)xy_tableViewCellTranspondedBgViewTap:(id)sender withObject:(id)object{ NSLog(@"\n转发事件触发了\n"); }
(void)lvTableViewCellArrowBtnClick:(id)sender withObject:(id)object{ XYTVCell * cell = object; // _selectedDynamicId = cell.lvNewsFrame.lvNewsItem.itemId; // [_lvMoreActionSheet showInView:self.view]; }
(void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. }
pragma mark-xy--------------------------点击事件位置------------------------------
(void)xy_requestPraiseWithDynamicId:(NSString )dynamicId withCell:(XYTVCell)cell{
cell.xy_praiseBtn.selected = YES; NSInteger praiseValue = [cell.xy_praiseBtn.currentTitle integerValue];
XYCellFrame * xyFrame = [_xyTVController.xy_statusFrame objectAtIndex:cell.tag];
xyFrame.xy_cellItem.itemPraiseStr = [NSString stringWithFormat:@"%ld",(long)praiseValue]; xyFrame.xy_cellItem.itemIsPraisedByMe = @"1";
praiseValue ++; [cell.xy_praiseBtn setTitle:[NSString stringWithFormat:@"%ld",(long)praiseValue] forState:UIControlStateNormal];
}
欢迎大家提意见,一起交流学习,会根据大家的反馈及时更新。谢谢! 如果小弟的一点点薄力可以给大家带来便利,小弟三生有幸!会再接再厉!您的支持就是我的动力! 还有 《自定义表情键盘》《类似微博首页自定义图文混排》,感兴趣的要关注哦!
- 自定义类似微博首页界面(图文混排,优化流畅性,高度封装)
- 类似微信表情图文混排(本地自定义表情)
- UILabel封装——生成富文本,计算文本高度,图文混排
- UILabel封装——生成富文本,计算文本高度,图文混排
- dedecms首页图文混排调用的方法
- Android自定义View 实现图文混排
- 自定义图文混排视图MyImageTextView
- Android 自定义控件进阶:图文混排
- PicWordView 图文混排自定义View
- 图文混排计算文字高度的代码
- react native 实现动态高度Listview 和图文混排
- IOS CoreText --- 图文混排之代码封装
- 自定义TextView实现图文混排及自定义省略符号
- iOS中 图文混排/自定义图文混排 作者:韩俊强
- iOS 保持界面流畅的技巧优化
- Android App界面和流畅度优化
- iOS 保持界面流畅性能优化
- Unity琐碎(3) UGUI 图文混排解决方案和优化
- 将web项目发布到Tomcat 服务器上的三种方法
- 支付宝集成过程详解——运行DEMO
- ExtJS4-页面控件(Form表单)
- qt SQL和tableView操作命令
- 模拟浏览器自动化测试工具Selenium之五Centos系统命令行下部署selenium环境试验
- 自定义类似微博首页界面(图文混排,优化流畅性,高度封装)
- TextView文字特效设计----跑马灯、闪烁文字
- 腾讯云直播api 删除视频接口POST 请求过程
- 将 Ubuntu 安装在 IBM Power System LC 服务器上
- 最新最火的十大网络流行语排行榜火热出炉,幽默搞笑网络段子来袭!
- 状态图
- collection和collections的区别
- Metrics.NET step by step
- 类路径读取JdbcUtil的配置文件