Skip to content
This repository was archived by the owner on Jul 1, 2020. It is now read-only.

Commit a48521d

Browse files
Fix image issue
1 parent 631f324 commit a48521d

4 files changed

Lines changed: 9 additions & 7 deletions

File tree

PullToRefreshKit/MainViewController.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import UIKit
1010
import AudioToolbox
1111

12+
// 如果你喜欢这个库,一个★就是对我最好的支持,项目地址 https://github.com/LeoMobileDeveloper/PullToRefreshKit
1213
class MainViewController: UITableViewController {
1314
var models = [SectionModel]()
1415
override func viewDidLoad() {

Source/Classes/Header.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ public class DefaultRefreshHeader:UIView,RefreshableHeader{
3030
addSubview(spinner)
3131
addSubview(textLabel)
3232
addSubview(imageView);
33-
imageView.image = UIImage(named: "arrow_down");
33+
let image = UIImage(named: "arrow_down", inBundle: NSBundle(forClass: self.dynamicType), compatibleWithTraitCollection: nil)
34+
imageView.image = image
3435
imageView.sizeToFit()
3536
imageView.frame = CGRectMake(0, 0, 24, 24)
3637
imageView.center = CGPointMake(frame.width/2 - 60 - 20, frame.size.height/2)

Source/Classes/Left.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ public enum RefreshKitLeftRightText{
1414
case releaseToAction
1515
}
1616
public class DefaultRefreshLeft:UIView,RefreshableLeftRight{
17-
public let imageView:UIImageView = UIImageView().SetUp {
18-
$0.image = UIImage(named: "arrow_right")
19-
}
17+
public let imageView:UIImageView = UIImageView()
2018
public let textLabel:UILabel = UILabel().SetUp {
2119
$0.font = UIFont.systemFontOfSize(14)
2220
}
@@ -39,6 +37,8 @@ public class DefaultRefreshLeft:UIView,RefreshableLeftRight{
3937
textLabel.numberOfLines = 0
4038
imageView.frame = CGRectMake(0, 0,20, 20)
4139
imageView.center = CGPointMake(40,frame.size.height/2)
40+
let image = UIImage(named: "arrow_right", inBundle: NSBundle(forClass: self.dynamicType), compatibleWithTraitCollection: nil)
41+
imageView.image = image
4242
textDic[.scrollToAction] = PullToRefreshKitLeftString.scrollToAction
4343
textDic[.releaseToAction] = PullToRefreshKitLeftString.releaseToAction
4444
textLabel.text = textDic[.scrollToAction]

Source/Classes/Right.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ import UIKit
1010

1111

1212
public class DefaultRefreshRight:UIView,RefreshableLeftRight{
13-
public let imageView:UIImageView = UIImageView().SetUp {
14-
$0.image = UIImage(named: "arrow_left")
15-
}
13+
public let imageView:UIImageView = UIImageView()
1614
public let textLabel:UILabel = UILabel().SetUp {
1715
$0.font = UIFont.systemFontOfSize(14)
1816
}
@@ -34,6 +32,8 @@ public class DefaultRefreshRight:UIView,RefreshableLeftRight{
3432
textLabel.numberOfLines = 0
3533
imageView.frame = CGRectMake(0, 0,20, 20)
3634
imageView.center = CGPointMake(10,frame.size.height/2)
35+
let image = UIImage(named: "arrow_left", inBundle: NSBundle(forClass: self.dynamicType), compatibleWithTraitCollection: nil)
36+
imageView.image = image
3737
textDic[.scrollToAction] = PullToRefreshKitRightString.scrollToAction
3838
textDic[.releaseToAction] = PullToRefreshKitRightString.releaseToAction
3939
textLabel.text = textDic[.scrollToAction]

0 commit comments

Comments
 (0)