admin
2023-04-21 0b3a4aaf99ea251bc8e27b96115288f0988fcffe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//
//  Starview.m
//  BuWanVideo2.0
//
//  Created by weikou2016 on 16/8/18.
//  Copyright © 2016年 com.yeshi.buwansheque.ios. All rights reserved.
//
 
#import "Starview.h"
 
@implementation Starview
 
+ (instancetype)initwithFrame:(CGRect)frame WithDic:(NSDictionary*)dic{
    
    NSArray* arrayView =  [[NSBundle mainBundle] loadNibNamed:@"Starview" owner:self options:nil];
    Starview *SV = [arrayView objectAtIndex:0];
    SV.frame = frame;
    SV.backgroundColor = [UIColor whiteColor];
    
    SV.image.layer.masksToBounds=YES;
    SV.image.layer.cornerRadius=40.0;
    
    //加载数据
    [SV.image setContentMode:UIViewContentModeScaleAspectFill];
    [SV.image setYthImageWithURL:[dic objectForKey:@"Portrait"] placeholderImage:[UIImage imageNamed:@"关注默认头像"]];
    SV.name.text = [dic objectForKey:@"Name"];
    SV.work.text = [NSString stringWithFormat:@"职业:%@",[dic objectForKey:@"Job"]];
    SV.Nationality.text = [NSString stringWithFormat:@"国籍:%@",[dic objectForKey:@"Country"]];
    SV.Production.text = [NSString stringWithFormat:@"代表作:%@",[dic objectForKey:@"Works"]];
    
    return SV;
}
 
 
 
@end