网站建设资讯

NEWS

网站建设资讯

tableviewcell自适应cell高度-创新互联

tableviewcell自适应cell高度

成都创新互联是专业的青山网站建设公司,青山接单;提供网站设计、网站建设,网页设计,网站设计,建网站,PHP网站建设等专业做网站服务;采用PHP框架,可快速的进行青山网站开发网页制作和功能扩展;专业做搜索引擎喜爱的网站,专业的做网站团队,希望更多企业前来合作!

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{    return self.arr.count;}- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{    UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];    cell.textLabel.numberOfLines = 100;    cell.textLabel.font = [UIFont systemFontOfSize:15];    cell.textLabel.text = self.arr[indexPath.row];    return cell;}- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{        NSString* text = self.arr[indexPath.row];        CGSize constraint = CGSizeMake(375-40, 100);            NSAttributedString* attributedText = [[NSAttributedString alloc]initWithString:text attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:15]}];        CGRect rect = [attributedText boundingRectWithSize:constraint options:NSStringDrawingUsesLineFragmentOrigin context:nil];        CGSize size = rect.size;        CGFloat height = MAX(size.height, 20);    NSLog(@"%f",height);    return height+10;        }

tableviewcell自适应cell高度

无限图片轮播Banner

// 网络加载图片的轮播器(只需一步设置即可使用)cycleScrollView.p_w_picpathURLStringsGroup = p_w_picpathsURLStrings;

现已支持cocoapods导入:pod 'SDCycleScrollView','~> 1.3'

如需更详细的设置,参考如下:

cycleScrollView.pageControlAliment = SDCycleScrollViewPageContolAlimentRight; // 设置pageControl居右,默认居中cycleScrollView.titlesGroup = 标题数组(数组元素个数必须和图片数组元素个数保持一致); // 如果设置title数组,则会在图片下面添加标题cycleScrollView.delegate = ; // 如需监听图片点击,请设置代理,实现代理方法cycleScrollView.autoScrollTimeInterval = ;// 自定义轮播时间间隔

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


文章题目:tableviewcell自适应cell高度-创新互联
文章转载:http://cdweb.net/article/dooses.html