-
Notifications
You must be signed in to change notification settings - Fork 0
/
ELCOverlayImageView.m
59 lines (49 loc) · 1.42 KB
/
ELCOverlayImageView.m
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//
// ELCOverlayImageView.m
// ELCImagePickerDemo
//
// Created by Seamus on 14-7-11.
// Copyright (c) 2014年 ELC Technologies. All rights reserved.
//
#import "ELCOverlayImageView.h"
#import "ELCConsole.h"
@implementation ELCOverlayImageView
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
}
return self;
}
- (void)setIndex:(int)_index
{
labIndex.text = [NSString stringWithFormat:@"%d",_index];
}
- (void)dealloc
{
labIndex = nil;
}
- (id)initWithImage:(UIImage *)image
{
self = [super init];
if (self) {
UIImageView *img = [[UIImageView alloc] initWithImage:image];
[self addSubview:img];
if ([[ELCConsole mainConsole] onOrder]) {
labIndex = [[UILabel alloc] initWithFrame:CGRectMake(5, 5, 16, 16)];
labIndex.backgroundColor = [UIColor redColor];
labIndex.clipsToBounds = YES;
labIndex.textAlignment = NSTextAlignmentCenter;
labIndex.textColor = [UIColor whiteColor];
labIndex.layer.cornerRadius = 8;
labIndex.layer.shouldRasterize = YES;
// labIndex.layer.borderWidth = 1;
// labIndex.layer.borderColor = [UIColor greenColor].CGColor;
labIndex.font = [UIFont boldSystemFontOfSize:13];
[self addSubview:labIndex];
}
}
return self;
}
@end