1.// 重新绘制cell边框 func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) { let cornerRadius: CGFloat = 10 cell.backgroundColor = UIColor.clearColor() let layer = CAShapeLayer() let pathRe…
//方法一: cell .contentView .backgroundColor = [ UIColor redColor ]; //方法二: UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier :CellIdentifier]; UIView* bgview = [[ UIView alloc ] initWithFrame :CGRectMake( 0 , 0 , 1 , 1 )]; bgview .op…
SnapKit是Swift中自动布局的框架,相当于Objective-C中的Masonry 下面是tableView自定义cell,使用SnapKit布局的效果图: 详细代码如下: TYCustomCell.swift import UIKit import SnapKit class TYCustomCell: UITableViewCell { var imgView: UIImageView? var titleLab:UILabel? var despLab:UILabel? requi…
IOS8 设置TableView Separatorinset 分割线从边框顶端开始   在ios8上 [TableViewsetSeparatorInset:UIEdgeInsetsMake(0,0,0,0)];不起作用 经过测试加入下面方法 在ios7 8上都可以正常工作 -(void)viewDidLayoutSubviews{    if ([self.tableView respondsToSelector:@selector(setSeparatorInset:)]) {      …
优化tableView加载cell与model的过程 效果图 说明 1. 用多态的特性来优化tableView加载cell与model的过程 2. swift写起来果然要比Objective-C简洁了不少 源码 https://github.com/YouXianMing/Swift-TableViewDemo https://github.com/YouXianMing/OC-TableViewDemo // // ViewController.swift // Swift-TableView…
初学swift 但是网上只有很多swift用xib创建的cell,就算是有也不是我想要的.今天自己弄了一个不用xib纯代码写的,来上代码 博客地址: https://github.com/liguoliangiOS/ZJGenWoYou.git 自定义cell 下面是controller 例外说一点懒加载 OC的懒加载 @property (nonatomic, strong) NSMutableArray * dataSource; - (NSMutableArray *)dataSource…
iOS中关于动态Tableview中的cell数据传输的多线程问题解决之拙见 (2015-12-05 12:48:20)[编辑][删除] 转载▼     首先我们先明确一下问题: 1.因为UI是在主线程中更新的,不能在down数据的同时显示界面,这样会使得下载的时间占用主线程,导致的后果就是你的屏幕就那样的卡死在哪了 2.如果要解觉问题1,就势必要将其下载数据的环节放在其他分线程上来实现,但是这里还会遇见一个问题,分线程的执行是不会有序的,这样,在动态显示的过 程中,cell中的数据就会混乱的变…
如何设置Linux swap分区 看到不少朋友问linux下swap分区的问题,收集到一篇 不错的文章 ,分享下. 什么是Swap?Swap,即交换区,除了安装Linux的时候,有多少人关心过它呢?其实,Swap的调整对Linux服务器,特别是Web服务器的性能至关重要.通过调整Swap,有时可以越过系统性能瓶颈,节省系统升级费用.Swap的原理是一个较复杂的问题,需要大量的篇幅来说明.在这里只作简单的介绍,在以后的文章中将和大家详细讨论Swap实现的细节.众所周知,现代操作系统都实现了“虚拟内…
更新tableView的某个cell 异步加载完数据后更新某个cell,这应该是非常常见的使用方法了,我们经常会用reloadData. 效果: 源码: // // RootViewController.m // DataTableView // // Copyright (c) 2014年 Y.X. All rights reserved. // #import "RootViewController.h" #import "SDWebImage.h" @inte…
使用HVTableView动态展开tableView中的cell 效果: 源码: HVTableView.h 与 HVTableView.m // // HVTableView.h // HRVTableView // // Created by Hamidreza Vakilian on 25/11/2013 // Copyright (c) 2013 Hamidreza Vakilian. All rights reserved. // Website: http://www.infracy…