Skip to content

Commit

Permalink
解决主题日报列表顶部图片更新问题
Browse files Browse the repository at this point in the history
  • Loading branch information
zpz1237 committed Oct 24, 2015
1 parent 107c5f6 commit fbcea64
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions zhihuDaily 2.0/ParallaxHeaderView.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@
- (void)layoutHeaderViewForScrollViewOffset:(CGPoint)offset;
- (void)layoutWebHeaderViewForScrollViewOffset:(CGPoint)offset;
- (void)layoutThemeHeaderViewForScrollViewOffset:(CGPoint)offset;
- (void)refreshBlurViewForNewImage;
@end
8 changes: 4 additions & 4 deletions zhihuDaily 2.0/ThemeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ class ThemeViewController: UIViewController {
navImageView = UIImageView(frame: CGRectMake(0, 0, self.view.frame.width, 64))
navImageView.contentMode = UIViewContentMode.ScaleAspectFill
navImageView.clipsToBounds = true
let image = UIImage(named: "ThemeImage")!
navImageView.image = image

//将其添加到ParallaxView
themeSubview = ParallaxHeaderView.parallaxThemeHeaderViewWithSubView(navImageView, forSize: CGSizeMake(self.view.frame.width, 64), andImage: navImageView.image) as! ParallaxHeaderView
Expand Down Expand Up @@ -100,8 +98,10 @@ class ThemeViewController: UIViewController {
}

//更新图片
// self.navImageView.sd_setImageWithURL(NSURL(string: data["background"].string!))
// self.themeSubview = ParallaxHeaderView.parallaxThemeHeaderViewWithSubView(self.navImageView, forSize: CGSizeMake(self.view.frame.width, 64), andImage: self.navImageView.image) as! ParallaxHeaderView
self.navImageView.sd_setImageWithURL(NSURL(string: data["background"].string!), completed: { (image, _, _, _) -> Void in
self.themeSubview.blurViewImage = image
self.themeSubview.refreshBlurViewForNewImage()
})

//注入themeContent
self.appCloud().themeContent = ThemeContentModel(stories: themeStory, background: data["background"].string!, editorsAvatars: editorsAvatars)
Expand Down

0 comments on commit fbcea64

Please sign in to comment.