How to Show count of Message in the inbox in ios -
i making inbox module want show message count on label. info coming server. if have 30 messages label show 30 messages. how can done? force notification concept utilize here or else?
create 1 uilablel
via programmatically or using iboutlet
, set frame
u want apply, set
#import <quartzcore/quartzcore.h> uilabel *label=[[uilabel alloc]initwithframe:cgrectmake(50, 50, 30, 30)]; //change frame size need label.layer.bordercolor = [uicolor whitecolor].cgcolor; label.layer.borderwidth = 2.0; label.layer.cornerradius = label.bounds.size.height / 2; label.textalignment=nstextalignmentcenter; label.layer.maskstobounds = yes; label.text=[nsstring stringwithformat:@"%d",yourarrayname.count]; // here add together message array name label.textcolor=[uicolor whitecolor]; label.backgroundcolor=[uicolor redcolor]; [self.view addsubview:label];
the output
ios
No comments:
Post a Comment