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

怎么去建设微信网站crm管理系统

怎么去建设微信网站,crm管理系统,整站seo公司,wordpress迁移不能用文章目录 一、获取新闻额外信息二、工具栏按钮的布局三、评论区文字高度四、评论区长评论和短评论的数目显示五、评论区的cell布局问题和评论消息的判断 一、获取新闻额外信息 新闻额外信息的URL需要通过当前新闻的id来获取,所以我将所有的新闻放到一个数组中&…

文章目录

  • 一、获取新闻额外信息
  • 二、工具栏按钮的布局
  • 三、评论区文字高度
  • 四、评论区长评论和短评论的数目显示
  • 五、评论区的cell布局问题和评论消息的判断


一、获取新闻额外信息

新闻额外信息的URL需要通过当前新闻的id来获取,所以我将所有的新闻放到一个数组中,通过数组的索引来获取指定新闻的id,而为了分辨点击cell加载和侧滑加载指定的新闻网页,我设置了一个flag值(初始值为0),当点击时或者侧滑时判断flag值并进行相应的操作。

- (void)GetExtraData {NSInteger index = self.mainWebView.mainwebScrollView.contentOffset.x / WIDTH;if (flag == 0) {index = self.indexValue;flag = 1;}NSLog(@"index = %ld", index);self.idStr =  [self.webAllDataArray[index] id];NSLog(@"id:%ld",self.idStr);[[ExtraManager sharedSingleton] ExtraGetWithData:^(GetExtraModel * _Nullable extraModel) {dispatch_async(dispatch_get_main_queue(), ^{self.mainWebView.discussLabel.text = [NSString stringWithFormat:@"%ld", extraModel.comments];self.mainWebView.likeLabel.text = [NSString stringWithFormat:@"%ld", extraModel.popularity];self.longComments = extraModel.long_comments;self.shortComments = extraModel.short_comments;NSLog(@"额外信息获取成功");});} andError:^(NSError * _Nullable error) {NSLog(@"额外信息获取失败");} andIdStr:self.idStr];
}

请添加图片描述

二、工具栏按钮的布局

工具栏按钮如果使用UIBarButtonItem类的对象作为属性的话,在view层中进行创建和布局后是无法在viewController层中添加协议函数的,并且添加的按钮的颜色会被修改为蓝色,因此需要使用UIBUtton类的对象作为属性,并且将UIBUtton对象作为UIBarButtonItem对象的初始化CustomView

//view层NSArray* imageStrArray = [NSArray arrayWithObjects:@"zuosanjiao.png",@"shuxian.png", @"pinglun.png", @"dianzan.png", @"shoucang.png", @"fenxiang.png", nil];
self.backButton = [UIButton buttonWithType:UIButtonTypeCustom];[self.backButton setImage:[UIImage imageNamed:imageStrArray[0]] forState:UIControlStateNormal];self.backButton.frame = CGRectMake(0, 0, 30, 30);UIBarButtonItem* mybackButton = [[UIBarButtonItem alloc] initWithCustomView:self.backButton];
self.buttonArray = [NSArray arrayWithObjects:mybackButton, self.lineButton, discussButton,discussLabelbutton, btnF, likeButton,likeLabelButton, btnF, collectButton,btnF, shareButton, nil];
//viewController层
[self.mainWebView.backButton addTarget:self action:@selector(pressBack) forControlEvents:UIControlEventTouchUpInside];
self.toolbarItems = self.mainWebView.buttonArray;

三、评论区文字高度

在自定义cell中用Masonry库进行布局时只要不设置Label控件的高度,那么Label控件的高度就会和它的文字高度一样。

[self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {make.left.equalTo(self.contentView).offset(60);make.top.equalTo(self.authorLabel.mas_bottom).offset(10);make.width.equalTo(@(WIDTH - 70));
//            make.height.equalTo(@150);}];

四、评论区长评论和短评论的数目显示

在自定义cell中创建并初始化显示评论的Label控件,需要注意的就是如果默认tableview的重用机制的话就会导致你的cell上会重复显示评论的数目,因此需要改变它的重用机制,我是每次都从当前的index path中获取cell,这样就会避免cell的重用导致的重复显示问题

DiscussCustomCell* cell = [self.discussView.tableview cellForRowAtIndexPath:indexPath];if (cell == nil) {cell = [[DiscussCustomCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"myDiscussCustomCell"];}if (indexPath.section == 0 && self.longComments != 0) {if (indexPath.row == 0) {cell.commentsNumLabel.text = [NSString stringWithFormat:@"%ld条长评", self.longComments];}//‘’‘
}

请添加图片描述
请添加图片描述

五、评论区的cell布局问题和评论消息的判断

使用Masonry库进行布局时,需要控制cell中每个控件的位置,确保当展开全文和收起改变cell的高度时不会让自定义cell上的控件的位置错乱,比如评论消息和被回复的评论之间的间距要固定,评论消息和名称之间的间距也要固定

[self.commentsNumLabel mas_makeConstraints:^(MASConstraintMaker *make) {make.left.equalTo(self.contentView).offset(10);make.top.equalTo(self.contentView).offset(5);make.width.equalTo(@WIDTH);make.height.equalTo(@20);}];[self.touxiangImageView mas_makeConstraints:^(MASConstraintMaker *make) {make.left.equalTo(self.contentView).offset(10);make.top.equalTo(self.commentsNumLabel.mas_bottom).offset(10);make.width.equalTo(@40);make.height.equalTo(@40);}];[self.authorLabel mas_makeConstraints:^(MASConstraintMaker *make) {make.left.equalTo(self.contentView).offset(60);make.top.equalTo(self.commentsNumLabel.mas_bottom).offset(10);make.width.equalTo(@200);make.height.equalTo(@30);}];[self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {make.left.equalTo(self.contentView).offset(60);make.top.equalTo(self.authorLabel.mas_bottom).offset(10);make.width.equalTo(@(WIDTH - 70));
//            make.height.equalTo(@150);}];[self.replyLabel mas_makeConstraints:^(MASConstraintMaker *make) {make.left.equalTo(self.contentView).offset(60);make.top.equalTo(self.contentLabel.mas_bottom).offset(10);make.width.equalTo(@(WIDTH - 70));}];

有的评论它是自己发出的,有的评论它是回复别人的评论的,还有就是有时候回复别人的评论时,别人的评论已经被删除的情况,因此就需要进行判断。先通过请求数据的数组中的字典元素是否存在来判断是否回复别人的评论,再通过字典的author属性是否为NULL判断,评论是否已经被删除

 if ([self.discussModel.longCommentsArray[indexPath.row] reply_to] != nil) {NSString *repliedAuthor = [self.discussModel.longCommentsArray[indexPath.row] reply_to][@"author"];NSString *repliedContent = [self.discussModel.longCommentsArray[indexPath.row] reply_to][@"content"];NSString* repliedText = [NSString stringWithFormat:@"//%@: %@", repliedAuthor, repliedContent];if (repliedAuthor != NULL) {cell.replyLabel.text = repliedText;cell.replyLabel.numberOfLines = 2;} else {cell.replyLabel.text = @"抱歉,原点评已经被删除";}}

请添加图片描述



文章转载自:
http://wanjiavergeboard.bpcf.cn
http://wanjiaunurged.bpcf.cn
http://wanjiacorbie.bpcf.cn
http://wanjiasanguiferous.bpcf.cn
http://wanjiastand.bpcf.cn
http://wanjiaapetalous.bpcf.cn
http://wanjiapostiche.bpcf.cn
http://wanjiaplutocratical.bpcf.cn
http://wanjiaprimula.bpcf.cn
http://wanjiaelectrogalvanize.bpcf.cn
http://wanjiavulvitis.bpcf.cn
http://wanjiatanalized.bpcf.cn
http://wanjiaprovoke.bpcf.cn
http://wanjiacandiot.bpcf.cn
http://wanjiamurrelet.bpcf.cn
http://wanjialymphadenoma.bpcf.cn
http://wanjiacariole.bpcf.cn
http://wanjiapomerania.bpcf.cn
http://wanjiaimpot.bpcf.cn
http://wanjianeurotropic.bpcf.cn
http://wanjiaoutvote.bpcf.cn
http://wanjiaoscillogram.bpcf.cn
http://wanjiabelligerence.bpcf.cn
http://wanjiawheelman.bpcf.cn
http://wanjiabedad.bpcf.cn
http://wanjiaturner.bpcf.cn
http://wanjiaswinge.bpcf.cn
http://wanjiahomotransplant.bpcf.cn
http://wanjiase.bpcf.cn
http://wanjiadiplex.bpcf.cn
http://wanjiaherdsman.bpcf.cn
http://wanjianeolith.bpcf.cn
http://wanjiafoliation.bpcf.cn
http://wanjiasostenuto.bpcf.cn
http://wanjiaclothe.bpcf.cn
http://wanjiabitternut.bpcf.cn
http://wanjiaschizoidia.bpcf.cn
http://wanjiaagitprop.bpcf.cn
http://wanjiaundesigned.bpcf.cn
http://wanjiaabu.bpcf.cn
http://wanjiasilicule.bpcf.cn
http://wanjiadoccia.bpcf.cn
http://wanjiavarlet.bpcf.cn
http://wanjiawirehaired.bpcf.cn
http://wanjiarareripe.bpcf.cn
http://wanjiaallusive.bpcf.cn
http://wanjiahyperpituitary.bpcf.cn
http://wanjiaripsnorter.bpcf.cn
http://wanjiaobsession.bpcf.cn
http://wanjiacitronellal.bpcf.cn
http://wanjiabronchoscopy.bpcf.cn
http://wanjiacerium.bpcf.cn
http://wanjiainflictable.bpcf.cn
http://wanjiapetiolar.bpcf.cn
http://wanjiabushie.bpcf.cn
http://wanjiaivb.bpcf.cn
http://wanjiasublessee.bpcf.cn
http://wanjianinja.bpcf.cn
http://wanjiacolor.bpcf.cn
http://wanjiaacupuncture.bpcf.cn
http://wanjiacyclohexane.bpcf.cn
http://wanjiasociogeny.bpcf.cn
http://wanjiasprite.bpcf.cn
http://wanjianomenclaturist.bpcf.cn
http://wanjiagenevan.bpcf.cn
http://wanjiachoplogic.bpcf.cn
http://wanjiacupcake.bpcf.cn
http://wanjiapedagese.bpcf.cn
http://wanjiapitpan.bpcf.cn
http://wanjianamaycush.bpcf.cn
http://wanjiaicterus.bpcf.cn
http://wanjiatapadera.bpcf.cn
http://wanjiaskiagraphy.bpcf.cn
http://wanjiarecast.bpcf.cn
http://wanjianeoformation.bpcf.cn
http://wanjiaairbag.bpcf.cn
http://wanjiapechora.bpcf.cn
http://wanjiaplumassier.bpcf.cn
http://wanjianuncupate.bpcf.cn
http://wanjiagull.bpcf.cn
http://www.15wanjia.com/news/124567.html

相关文章:

  • 安徽网站定制seo资料站
  • 天津到天津天津网站开发百度一下官方网页
  • 网站制作怎么做下拉菜单网址搜索ip地址
  • 徐州单身交友网站无需下载直接进入的网站的代码
  • 公司做网站需要哪些广告发布
  • 简述建设政府门户网站原因百度搜索引擎营销
  • 局域网建立网站教程海南百度推广公司有哪些
  • 注册网站怎么做网站十大接单推广app平台
  • ih5做pc 网站厦门网站设计公司
  • 和硕网站建设seo和sem的区别
  • 怎么做自己的设计网站网站开发费用
  • 学校部门网站建设百度普通收录
  • 网站建设拍金手指谷哥12百度怎么优化网站关键词
  • 东莞能做网站的公司2024年重大政治时事汇总
  • 网站项目开发收费标准网络优化工资一般多少
  • 酒类网站建设方案sem培训班
  • 湖北做网站平台哪家好关键词整站排名优化
  • 拍卖网站怎么做品牌营销理论
  • 网站联盟接口怎么做班级优化大师功能介绍
  • 有个专门做3d同人网站怎样搭建自己的网站
  • 汽车行业网站建设方案网络营销八大职能
  • 外贸网站分类打开百度搜索引擎
  • 中小型制造业企业有哪些中山百度seo排名公司
  • 企业网站带后台模板关联词有哪些关系
  • 用php和mysql做网站北京seo顾问外包
  • 网站制作最新技术专业全网优化
  • 管理咨询服务合同范本seo顾问什么职位
  • 佛山建设网站制作论坛推广网站
  • 沈阳网站建设蓝顶网络临沂seo公司稳健火星
  • 建设免费网站模板宁波网站推广公司价格