I want to make a facebook like newsfeed with a profile name message and picture. I have been trying to add uilabels over the image view manually specifying their frames @implementation FacebookCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame{
self = [super initWithFrame:frame];
if (self)
{
// change to our custom selected background view
self.imageView = [[UIImageView alloc] init];
}
return self;
}
-(void) setFeed:(FacebookFeed *)feed{
_feed = feed;
self.image = [UIImage imageWithData:[NSData dataWithContentsOfURL:feed.imageURL]];
self.imageView.image = self.image;
self.messageLabel = (UILabel *)feed.message;
self.nameLabel = (UILabel *)@“DCE Speaks Up”;
self.nameLabel.frame = CGRectMake(10, 10, 45, 10);
self.messageLabel.frame = CGRectMake(10, 20, self.contentView.bounds.size.width - 10, 45);
[self.contentView addSubview:self.messageLabel];
[self.contentView addSubview:self.nameLabel];
}
-(void) layoutSubviews{
self.imageView.frame = CGRectMake(15, 75, self.contentView.bounds.size.width - 20, self.contentView.bounds.size.height - 75);
[self.contentView addSubview:self.imageView];
}
@end