У меня есть несколько UITextView
, которые я создал с программным обеспечением для цикла. Я пытаюсь добавить UILabel
в верхний левый угол каждого UITextView
. Как я могу это сделать?Добавить UILabel в UITextView
Мой UITextView
код:
for (int i = 0; i < 10; i++){
UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(0, yPos, 375,height)];
[textView setBackgroundColor:[UIColor lightGrayColor]]; //set different property like this
UIColor *borderColor = [UIColor colorWithRed:204.0/255.0 green:204.0/255.0 blue:204.0/255.0 alpha:1.0];
textView.layer.borderColor = borderColor.CGColor;
textView.layer.borderWidth = 1.0;
textView.layer.cornerRadius = 5.0;
textView.textAlignment=NSTextAlignmentRight;
textView.editable=NO;
[CommentScrooll addSubview:textView ];
// CommentScroll Is the name of my viewcontroller
yPos += (height + padding);
}
ча вы пишете, что в Objective-C, пожалуйста? –
@ A.M Посмотрите на мой код. –