12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- //
- // KBPopRouleView.m
- // YouHuiProject
- //
- // Created by 小花 on 2018/10/15.
- // Copyright © 2018年 kuxuan. All rights reserved.
- //
- #import "KBPopRouleView.h"
- @implementation KBPopRouleView
- - (instancetype)initWithFrame:(CGRect)frame text:(NSString *)text {
- self = [super initWithFrame:frame];
- if (self) {
- self.layer.cornerRadius = Fitsize(8);
- self.backgroundColor = [UIColor whiteColor];
- UIImageView *icon = [[UIImageView alloc] initWithFrame:CGRectMake(0, -Fitsize(90), Fitsize(241), Fitsize(241))];
- icon.contentMode = UIViewContentModeScaleAspectFill;
- icon.centerX = self.width/2;
- icon.image = [UIImage imageNamed:@"sign_roule"];
- [self addSubview:icon];
-
- UILabel *des = [[UILabel alloc] initWithFrame:CGRectMake(10, Fitsize(130), self.width-20, Fitsize(200))];
- des.numberOfLines = 0;
- des.textColor = [UIColor YHColorWithHex:0x2A2A2A];
- des.font = [UIFont systemFontOfSize:Fitsize(14)];
- des.text = text;
- [des sizeToFit];
- des.centerX = self.width/2;
- des.textAlignment = NSTextAlignmentCenter;
- des.y = Fitsize(130);
- [self addSubview:des];
-
-
- }
- return self;
- }
- @end
|