-(id)initWithProductCode:(NSString*)p_pc width_cm:(NSString*)p_wcm length_cm:(NSString*)p_lcm thickness_mm:(NSString*)p_tmm isBard:(BOOL)p_isBard
{
self = [super init];
if (self) {
// Custom initialization
int x = 0;
int y = 5;
int width = 105;
int height = 30;
_font = [UIFont fontWithName:@"Arial" size:14];
_isBard = p_isBard;
_productCodeL = [[UILabel alloc] init];
_productCodeL.frame = CGRectMake(x, y, width, height);
_productCodeL.font = _font;
_productCodeL.textAlignment = UITextAlignmentCenter;
_productCodeL.numberOfLines = 2;
_productCodeL.text = p_pc;
[self addSubview:_productCodeL];
_widthcmL = [[UILabel alloc] init];
_widthcmL.frame = CGRectMake(x+(width), y, width, height);
_widthcmL.font = _font;
_widthcmL.textAlignment = UITextAlignmentCenter;
_widthcmL.text = p_wcm;
[self addSubview:_widthcmL];
_lengthcmL = [[UILabel alloc] init];
_lengthcmL.frame = CGRectMake(x+(width*2) - 10, y, width, height);
_lengthcmL.font = _font;
_lengthcmL.textAlignment = UITextAlignmentCenter;
_lengthcmL.text = p_lcm;
[self addSubview:_lengthcmL];
_thicknessmmL = [[UILabel alloc] init];
_thicknessmmL.frame = CGRectMake(x+(width*3) - 15, y, width, height);
_thicknessmmL.font = _font;
_thicknessmmL.textAlignment = UITextAlignmentCenter;
_thicknessmmL.text = p_tmm;
[self addSubview:_thicknessmmL];
if(_isBard){
_productCodeL.backgroundColor = [UIColor clearColor];
_widthcmL.backgroundColor = [UIColor clearColor];
_lengthcmL.backgroundColor = [UIColor clearColor];
_thicknessmmL.backgroundColor = [UIColor clearColor];
}
else{
_productCodeL.backgroundColor = [UIColor whiteColor];
_widthcmL.backgroundColor = [UIColor whiteColor];
_lengthcmL.backgroundColor = [UIColor whiteColor];
_thicknessmmL.backgroundColor = [UIColor whiteColor];
}
}
return self;
}
this probably gets called at least 700 times.
|