| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- //
- // MineItemView.m
- // 千模
- //
- // Created by Drew on 2018/10/24.
- // Copyright © 2018年 MUMEI. All rights reserved.
- //
- #import "MineItemView.h"
- @interface MineItemView ()
- @property (weak, nonatomic) IBOutlet UIImageView *iconImageView;
- @property (weak, nonatomic) IBOutlet UILabel *menuLabel;
- @end
- @implementation MineItemView
- - (instancetype)initWithFrame:(CGRect)frame{
- if(self = [super initWithFrame:frame]){
- NSBundle *bundle = [NSBundle bundleForClass:[self class]];
- NSString *className = NSStringFromClass([self class]);
- UIView *view = [[bundle loadNibNamed:className owner:self options:nil] firstObject];
- view.frame = self.bounds;
- [self addSubview:view];
- }
- return self;
- }
- - (instancetype)initWithCoder:(NSCoder *)aDecoder{
- if(self = [super initWithCoder:aDecoder]){
- NSBundle *bundle = [NSBundle bundleForClass:[self class]];
- NSString *className = NSStringFromClass([self class]);
- UIView *view = [[bundle loadNibNamed:className owner:self options:nil] firstObject];
- view.frame = self.bounds;
- [self addSubview:view];
- }
- return self;
- }
- -(void)setIcon:(NSString *)icon{
- self.iconImageView.image = [UIImage imageNamed:icon];
- }
- -(void)setLabel:(NSString *)label{
- self.menuLabel.text = label;
- }
- -(void)setImage:(UIImage *)image{
- self.iconImageView.image = image;
- }
- @end
|