本文图片在上,文字在下
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface BaseImageTextView : UIView
@property(nonatomic, strong) void(^clickView)(void);//给控件添加点击事件
@property(nonatomic, strong) UILabel *titleLabel;
@property(nonatomic, strong) UIImageView *imgView;
@property(nonatomic, strong) UIView *redCircle;
@property(nonatomic, strong) UILabel *numLabel;
@end
NS_ASSUME_NONNULL_END
#import "BaseImageTextView.h"
@implementation BaseImageTextView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self addSubview:self.imgView];
[self addSubview:self.titleLabel];
[self addSubview:self.redCircle];
[self.redCircle addSubview:self.numLabel];
__weak typeof(self) ws = self;
[self addTapActionWithBlock:^(UIG