0
UIView
/UILabel
この画像のようにプログラムでの目的はです。特に中央のエッジ。誰も助けることができますか? Objective-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