XWPhotoCell.m 902 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. //
  2. // XWPhotoCell.m
  3. // XWPublishDemo
  4. //
  5. // Created by 邱学伟 on 16/4/15.
  6. // Copyright © 2016年 邱学伟. All rights reserved.
  7. //
  8. #import "XWPhotoCell.h"
  9. @implementation XWPhotoCell
  10. /** 查看大图 */
  11. - (void)setBigImgViewWithImage:(UIImage *)img{
  12. if (_BigImgView) {
  13. //如果大图正在显示,还原小图
  14. _BigImgView.frame = _profilePhoto.frame;
  15. _BigImgView.image = img;
  16. }else{
  17. _BigImgView = [[UIImageView alloc] initWithImage:img];
  18. _BigImgView.frame = _profilePhoto.frame;
  19. [self insertSubview:_BigImgView atIndex:0];
  20. }
  21. _BigImgView.contentMode = UIViewContentModeScaleToFill;
  22. }
  23. - (void)awakeFromNib {
  24. [super awakeFromNib];
  25. // Initialization code
  26. _profilePhoto.clipsToBounds = YES;
  27. _profilePhoto.layer.cornerRadius = 2;
  28. _profilePhoto.contentMode = UIViewContentModeScaleAspectFill;
  29. }
  30. @end