Really? It worked out well. Please check this as I executed my UITextView.HELP_STATIC_CONTENT there is a constant variable that contains static texts for the help screen, which contains many texts (about 500 lines).
UITextView *lblHelp = [[UITextView alloc]initWithFrame:CGRectMake(10, 10, self.view.frame.size.width - 20, self.view.frame.size.height - 20)]; [lblHelp setBackgroundColor:[UIColor clearColor]]; [lblHelp setEditable:NO]; [lblHelp setSelectable:NO]; lblHelp.showsVerticalScrollIndicator=NO; lblHelp.showsHorizontalScrollIndicator=NO; [self.view addSubview:lblHelp]; NSString *string = HELP_STATIC_CONTENT; NSMutableAttributedString *attrString = [[NSMutableAttributedString alloc] initWithString:string]; NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle defaultParagraphStyle] mutableCopy]; paragraphStyle.alignment=NSTextAlignmentJustified; [paragraphStyle setLineSpacing:3]; [attrString beginEditing]; [attrString addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:12] range:NSMakeRange(0, string.length)]; [attrString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, string.length)]; [attrString endEditing]; lblHelp.attributedText = attrString;
handiansom
source share