File tree Expand file tree Collapse file tree
Assets.xcassets/photo.imageset Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ {
2+ "images" : [
3+ {
4+ "idiom" : " universal" ,
5+ "filename" : " photo.png" ,
6+ "scale" : " 1x"
7+ },
8+ {
9+ "idiom" : " universal" ,
10+ "scale" : " 2x"
11+ },
12+ {
13+ "idiom" : " universal" ,
14+ "scale" : " 3x"
15+ }
16+ ],
17+ "info" : {
18+ "version" : 1 ,
19+ "author" : " xcode"
20+ }
21+ }
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ class CustomTableViewCell: UITableViewCell {
4949 imgView1. image = UIImage ( named: imgName)
5050 imgView2. image = UIImage ( named: imgName)
5151 imgView3. image = UIImage ( named: imgName)
52- imgView4. image = UIImage ( named: imgName )
52+ imgView4. image = UIImage ( named: " photo " )
5353 }
5454
5555 override func setSelected( selected: Bool , animated: Bool ) {
Original file line number Diff line number Diff line change 11# CornerRadius
22
3+ 参考了这篇文章:[ 小心别让圆角成了你列表的帧数杀手] ( http://www.cocoachina.com/ios/20150803/12873.html )
4+
35都说 ` cornerRadius ` + ` masksToBounds ` 会导致离屏渲染,从而大幅度降低 ` UITabelView ` 滑动时的性能。
46
5- 我做了一个 demo,在 cell 中放了四个 UIImageView,但是在 Instument 中检测时并没有发现离屏渲染,滑动时帧数也未见下降 。
7+ 我做了一个 demo,在 cell 中放了四个 UIImageView,令我惊讶的是,使用不同的图片可能会导致不同的结果。有些图片设置圆角会导致离屏渲染,有些则不会。即使四个图片都导致了离屏渲染,也并没有看到滑动时帧数的下降 。
You can’t perform that action at this time.
0 commit comments