ios - Objective-c : Designing UIView/UILabel Programmatically -
i want design uiview
/uilabel
image programmatically in objective c. specially edge in middle . can ?
currently have :
uilabel *mylabel = [[uilabel alloc] initwithframe:cgrectmake(self.tabposition.x,self.tabposition.y,120,20)]; //or whatever size need mylabel.center = self.tabposition; [mylabel setfont:[uifont systemfontofsize:12]]; mylabel.backgroundcolor = [[uicolor blackcolor] colorwithalphacomponent:0.6f]; mylabel.textcolor = [uicolor whitecolor]; mylabel.textalignment = nstextalignmentcenter; mylabel.text = [nsstring stringwithformat:@"%@ %@",data.user.firstname,data.user.lastname] ; mylabel.tag = indexpath.row; mylabel.userinteractionenabled = yes; uipangesturerecognizer *gesture = [[uipangesturerecognizer alloc] initwithtarget:self action:@selector(labeldragged:)] ; [mylabel addgesturerecognizer:gesture]; [self.picture addsubview:mylabel];
a lot of answers available, choose fits you:
hope these !!
Comments
Post a Comment