0

I am having a problem with UITextView. On simulator it shows me the UITextView normally without any cut but when I run the project on real device, I am getting the cut in the middle.

self.popisakce.text = [self.objc objectForKey:@"Class"];
        [self.popisakce sizeToFit]; //added
        [self.popisakce layoutIfNeeded]; //added
        [self.popisakce sizeToFit];
        CGRect frame = self.popisakce.frame;
            CALayer *imageLayerRRR = self.popisakce.layer;
            [imageLayerRRR setCornerRadius:5];
            [imageLayerRRR setMasksToBounds:YES];

            UIScrollView* scrollview = [[UIScrollView alloc] initWithFrame:CGRectMake(0,25,768, 900)];
            scrollview.showsVerticalScrollIndicator=YES;
            scrollview.scrollEnabled=YES;
            scrollview.userInteractionEnabled=YES;
            [self.view addSubview:scrollview];
            scrollview.contentSize = CGSizeMake(768,frame.size.height+770);

Below is my output:

link

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Milan1111
  • 185
  • 3
  • 13

2 Answers2

1

When you put text in a UITextView which is not visible, it may not be fully displayed.

Try moving the line self.popisakce.text = [self.objc objectForKey:@"Class"]; lower in the code flow.

dibi
  • 3,257
  • 4
  • 24
  • 31
Vincent
  • 4,342
  • 1
  • 38
  • 37
  • I m having problem right now just with the long one TextViews – Milan1111 Sep 02 '14 at 08:38
  • Look at the solution above. The order in which you define the actions in Code is important. By changing the order, you can most certain solve this. 1) define 2) fill – Vincent Sep 09 '14 at 17:27
0

[textView setScrollEnabled:NO]; fixed the problem.

Milan1111
  • 185
  • 3
  • 13