autoresizing

#import "LYTopicPictureView.h"
#import "LYTopic.h"
#import "UIImageView+WebCache.h"

@interface LYTopicPictureView()
 
@property (weak, nonatomic) IBOutlet UIImageView *imageView;
@property (weak, nonatomic) IBOutlet UIImageView *gifView;
@property (weak, nonatomic) IBOutlet UIButton *seeBigButton;

@end

@implementation LYTopicPictureView

- (void)awakeFromNib {
    self.autoresizingMask = UIViewAutoresizingNone;
}

+ (instancetype)pictureView {
    return [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil] lastObject];
}

- (void)setTopic:(LYTopic *)topic {
    _topic = topic;
    // 设置图片
    [self.imageView sd_setImageWithURL:[NSURL URLWithString:topic.image1] placeholderImage:[UIImage imageNamed:@"imagexxxx.jpg"]];
}

@end

你可能感兴趣的:(autoresizing)