个人资料页礼物适配大小
This commit is contained in:
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "1024ï¼1024 1.png",
|
||||
"filename" : "1024.png",
|
||||
"idiom" : "universal",
|
||||
"platform" : "ios",
|
||||
"size" : "1024x1024"
|
||||
|
@@ -20,8 +20,8 @@
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
NetImageConfig * config = [[NetImageConfig alloc]init];
|
||||
config.imageType = ImageTypeUserIcon;
|
||||
NetImageConfig *config = [[NetImageConfig alloc]init];
|
||||
config.imageType = ImageTypeUserInfoAlbum;
|
||||
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
||||
_imageView = [[NetImageView alloc] initWithConfig:config];
|
||||
_imageView.layer.masksToBounds = YES;
|
||||
|
@@ -51,7 +51,7 @@
|
||||
|
||||
[self.contentView addSubview:self.numberImageView];
|
||||
[self.numberImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.top.mas_equalTo(8);
|
||||
make.left.top.mas_equalTo(4);
|
||||
make.width.height.mas_equalTo(20);
|
||||
}];
|
||||
}
|
||||
@@ -170,12 +170,17 @@
|
||||
[self.giftsCollectionView reloadData];
|
||||
}
|
||||
|
||||
+ (CGFloat)cellHeight:(BOOL)isExpand source:(NSArray *)dataSource {
|
||||
+ (CGFloat)cellHeight:(BOOL)isExpand
|
||||
source:(NSArray *)dataSource {
|
||||
|
||||
NSInteger width = (KScreenWidth - 28 - 30)/4;
|
||||
NSInteger height = width * 120 / 86;
|
||||
|
||||
if (isExpand) {
|
||||
NSInteger line = (dataSource.count / 4) + (dataSource.count % 4 > 0 ? 1 : 0);
|
||||
return MAX(line * 120 + line * 10, 120);
|
||||
return MAX(line * height + line * 10, height);
|
||||
} else {
|
||||
return 120;
|
||||
return height;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,8 +206,12 @@
|
||||
|
||||
#pragma mark - UICollectionViewDelegateFlowLayout
|
||||
|
||||
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||
return CGSizeMake(86, 120);
|
||||
- (CGSize)collectionView:(UICollectionView *)collectionView
|
||||
layout:(UICollectionViewLayout *)collectionViewLayout
|
||||
sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||
NSInteger width = (KScreenWidth - 28 - 30)/4;
|
||||
NSInteger height = width * 120 / 86;
|
||||
return CGSizeMake(width, height);
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
Reference in New Issue
Block a user