在scrollview中输入纯文本以进行textview

时间:2013-12-18 15:48:13

标签: ios objective-c uiscrollview uitextview

我想输入从json解析和格式化textview scrollview或者建议我收到的文本,所以我想制作 enter image description here

1 个答案:

答案 0 :(得分:0)

UILabel * label = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, self.scrollView.frame.size.width - 20, 200)];
label.textAlignment = NSTextAlignmentJustified;
label.backgroundColor = [UIColor clearColor];
label.text = @"Lorem ipsum text";
label.font = [UIFont systemFontOfSize:18]; // or use [UIFont fontWithName:@"HelveticaNeue" size:18];
label.textColor = [UIColor blackColor];
[self.view addSubview:label];

依此类推,对于您拥有的每个文字,您都可以添加标签并更改其属性,添加新属性或根据需要减去现有属性。

相关问题