diff --git a/librx/Base.lproj/Main.storyboard b/librx/Base.lproj/Main.storyboard
index eca413a..592ccef 100644
--- a/librx/Base.lproj/Main.storyboard
+++ b/librx/Base.lproj/Main.storyboard
@@ -3,7 +3,6 @@
-
@@ -661,7 +660,7 @@
-
+
@@ -683,7 +682,7 @@
-
+
@@ -1772,7 +1681,7 @@
-
+
diff --git a/librx/StorysTableViewController.swift b/librx/StorysTableViewController.swift
index e502b21..060adf8 100644
--- a/librx/StorysTableViewController.swift
+++ b/librx/StorysTableViewController.swift
@@ -39,7 +39,7 @@ class StorysTableViewController: UITableViewController {
self.refreshControl?.attributedTitle = NSAttributedString(string: "下拉可以刷新数据")
self.refreshControl?.tintColor = UIColor(red: 46/255.0, green: 204/255.0, blue: 113/255.0, alpha: 1.0)
self.refreshControl?.addTarget(self, action: "refresh", forControlEvents: .ValueChanged)
- self.refreshControl?.backgroundColor = UIColor.lightGrayColor()
+ self.refreshControl?.backgroundColor = self.tableView.backgroundColor
self.tableView.addSubview(refreshControl!)
@@ -70,9 +70,9 @@ class StorysTableViewController: UITableViewController {
// reload data when view did appear
self.tableView.reloadData()
- if !isInlineOfContainer {
- self.tableView.contentInset.top = 160
- }
+// if !isInlineOfContainer {
+// self.tableView.contentInset.top = 160
+// }
// load data at first time
if firstTime {
@@ -101,6 +101,8 @@ class StorysTableViewController: UITableViewController {
cell.delegate = self
+ print("\(post.url): \(post.title)" )
+
cell.nameLabel.text = post.title
cell.nameLabel.lineBreakMode = NSLineBreakMode.ByWordWrapping
cell.nameLabel.numberOfLines = 2
@@ -113,10 +115,16 @@ class StorysTableViewController: UITableViewController {
cell.likeNumLabel.text = String(post.likeCount)
cell.timeDiffLabel.text = DateUtil.timeDiff(post.getFormatCreateDateTime())
- let thumbnailUrl = NSURL(string: post.thumbnail)
let avatarUrl = NSURL(string: post.firstSharer.avatar)
+ let thumbnailUrl = NSURL(string: post.thumbnail)
- cell.thumbnilImageView.sd_setImageWithURL(thumbnailUrl, placeholderImage: UIImage(named: "default"))
+ if post.url.containsString("github") {
+ cell.thumbnilImageView.image = UIImage(named: "GitHub")
+ } else if post.url.containsString("zhihu"){
+ cell.thumbnilImageView.image = UIImage(named: "zhihu")
+ }else{
+ cell.thumbnilImageView.sd_setImageWithURL(thumbnailUrl, placeholderImage: UIImage(named: "default"))
+ }
cell.thumbnilImageView.layer.cornerRadius = 6
cell.thumbnilImageView.clipsToBounds = true
cell.thumbnilImageView.layer.borderWidth = 1
@@ -201,6 +209,15 @@ class StorysTableViewController: UITableViewController {
}
+ func defaultThumbnail(post:Post) -> String {
+
+ if post.url.containsString("github") {
+ return "GitHub"
+ }
+ return "default"
+
+ }
+
func refresh() {
refreshContent()
self.tableView.reloadData()