ios - Set Image inline with text to UITextView in Objective C -


i want add image inline text uitextview below screenshot

enter image description here


have try using nstextattachment , nsattributedstring put 1 line before & after image.

please me sort out.

you need use 'uibezierpath'

for example,

txtvhtmlstring.text = @“your long text…….”;  imgview = [[uiimageview alloc] initwithframe:cgrectmake(120, 100, 152, 128)];  imgview.image = [uiimage imagenamed:@"smily.png"];      imgview.layer.cornerradius = 10; [txtvhtmlstring addsubview:imgview]; 

then don't forget update bezierpath in viewdidlayoutsubviews if text updated.

- (void)viewdidlayoutsubviews {     uibezierpath *exclusionpath = [uibezierpath bezierpathwithrect:imgview.frame];     txtvhtmlstring.textcontainer.exclusionpaths  = @[exclusionpath]; } 

Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -