After I investigate custom font (especially arabic) is not working UITextView
using attributedString
, below is what I did.
I just wanted to display the text in UITextView
(for About Us in my app) as it has long text and I wanted scrolling option.
Below is what I did.
Add
UIScrollView
Add
UILabel
insideUIScrollView
Assign text to
UILabel
.abtUsLabel.attributedText = attributedString;
Make label
sizeToFit
[abtUsLabel sizeToFit];
This is very important step, else it won't work.
Set scrollview
contentSize
as per label height.[abtUsScrollView setContentSize:CGSizeMake(abtUsScrollView.frame.size.width, abtUsLabel.frame.size.height)];
Done... now if the Label is longer, we can scroll it.