我在 UITextView 中显示文本。我需要对文本应用一些填充。当我使用最高位置的价值时,它正在工作。如果我将值用于其他位置,则它不起作用。
txtt_bgImage = [UIImage imageNamed:@"txtt_bg_ipad.png"];
txtt_bgImageView = [[UIImageView alloc] initWithImage:txtt_bgImage];
txtt=[[UITextView alloc]initWithFrame:CGRectMake(170, 300, 400, 250)];
txtt.text=productDescription;
[txtt setFont: [UIFont fontWithName:@"verdana" size:15]];
txtt.textColor=[UIColor whiteColor];
[txtt setBackgroundColor:[UIColor clearColor]];
txtt.contentInset = UIEdgeInsetsMake(15,0,0,0);
// [txtt setTextContainerInset:UIEdgeInsetsMake(7, 7, 0, 0)];
txtt_bgImageView.frame=CGRectMake(170, 300, 400, 250);
[self.view addSubview:txtt_bgImageView];
txtt.editable=NO;
NSLog(@"text is %@",txtt.text);
object.object_screentext = txtt;
[self.view addSubview:txtt];