Я хочу создать UIView
/UILabel
как это изображение программно в Объектив c. Специально край в середине. Может ли кто-нибудь помочь?Цель: Проектирование UIView/UILabel Программно
В настоящее время у меня есть:
UILabel *myLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.tabPosition.x,self.tabPosition.y,120,20)]; //or whatever size you 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];
В чем же ваша проблема/вопрос? – Sebastian
будет ли ваш край всегда посередине? – Alok