ios - Displaying Rich Text File in UITextView Causes Choppy/Slow Scrolling -


im loading non-english (hebrew) rich text file uitextview so.

self.textview.attributedtext =     [nsattributedstring.alloc      initwithfileurl:[ nsbundle.mainbundle urlforresource:@"textfile" withextension:@"rtf"  ]      options:nil      documentattributes:nil      error:null      ]; 

everything loaded correctly , file scrolls, gets choppy on way down. assume rendering issue uitextview.

is there other library or way make scrolling smooth. note: uitextview non-editable , non-selectable already.

this may not ideal, i've had idea work in similar situations. try increasing height of uitextview(to create sort of buffer). may have adjust scrollindicatorinsets, contentinsets, layer.zposition of various uiview's, , possibly make uitextview transparent uitextview behind proper size/border/etc depending on layout.

option 2

uiscrollview *scrollview = [[uiscrollview alloc] initwithframe:cgrectmake(40, 100, 200, 100)]; scrollview.scrollenabled = yes; scrollview.contentinset = uiedgeinsetszero; [self.view addsubview:scrollview];  uilabel *label = [[uilabel alloc] initwithframe:cgrectmake(0, 0, scrollview.bounds.size.width, height)]; label.text = @"text"; label.numberoflines = 0; [scrollview addsubview:label]; scrollview.contentsize = cgsizemake(label.bounds.size.width, label.bounds.size.height); 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -