Ich habe mehrere UITextView
, die ich mit einer for-Schleife programmgesteuert erstellt habe. Ich versuche, eine UILabel
an der oberen linken Ecke von jedem UITextView
auch hinzuzufügen. Wie kann ich das tun?UILabel zu UITextView hinzufügen
Mein UITextView
Code:
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);
}
ca Sie schreiben es in Objective-c bitte? –
@ A.M schau auf meinen Code. –