Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 08-03-2011, 09:20 PM   #1 (permalink)
Registered Member
 
Join Date: Aug 2011
Posts: 2
lemerman9 is on a distinguished road
Unhappy UILabel blackout background

Once in a while my UILabel background, originally clearColor, would blackout or turn black. I am, however, creating quite a number of UILabels on one UIView, so my only guess is that it has to do with the ipad memory... is there any way I could prevent this from happening? Has this happened to anyone else and have solved this problem?
lemerman9 is offline   Reply With Quote
Old 08-04-2011, 04:56 AM   #2 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

generally labela background doesn't change magically

so post the code that you written that involve labels...
__________________
dany_dev is offline   Reply With Quote
Old 08-06-2011, 09:04 PM   #3 (permalink)
Registered Member
 
Join Date: Aug 2011
Posts: 2
lemerman9 is on a distinguished road
Default

-(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.
lemerman9 is offline   Reply With Quote
Reply

Bookmarks

Tags
black background, blackout, uilabel

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 390
15 members and 375 guests
7twenty7, blasterbr, buggen, chiataytuday, dedeys78, dre, fiftysixty, HemiMG, jimmyon122, jonathandeknudt, LEARN2MAKE, nyoe, pungs, tymex, UMAD
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,669
Threads: 94,121
Posts: 402,903
Top Poster: BrianSlick (7,990)
Welcome to our newest member, dedeys78
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 04:03 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0