optonaut / ActiveLabel.swift

UILabel drop-in replacement supporting Hashtags (#), Mentions (@) and URLs (http://) written in Swift
MIT License
4.47k stars 686 forks source link

Label cannot be multiline in Arabic text #154

Closed RajChanchal closed 5 years ago

RajChanchal commented 7 years ago

screen shot 2017-02-05 at 4 58 28 pm Tried numberOfLines = 2 And Height is also enough to accommodate. Following is the code, where lblPrivacyPolicy is the label

lblPrivacyPolicy.numberOfLines = 2
let customType = ActiveType.custom(pattern: "\\sخدمة وسياسة\\b")
lblPrivacyPolicy.enabledTypes.append(customType)
lblPrivacyPolicy.text = "أوافق على بنود خدمة وسياسة خصوصية تطبيق ميحد حمد"
lblPrivacyPolicy.textColor = .white
lblPrivacyPolicy.customColor[customType] = kGoldColor
lblPrivacyPolicy.customSelectedColor[customType] = .white
lblPrivacyPolicy.handleCustomTap(for: customType) { _ in print("Custom type")
            self.poppop()
}
AbubakerM commented 6 years ago

I solved this problem by adding number of spaces (like this: " ") until the whole string appears ... it may seem not effective solution but if works for me rather than its not repeated more than two times in my app.

SalehAlDhobaie commented 5 years ago

is still this issue is this issue still exist ?

maziyarpanahi commented 5 years ago

Hi @RajChanchal, if you change your lblPrivacyPolicy.text to English with the same number of character or more, does it show without truncating? Just checking to make sure this doesn' happen because of other reasons. We have users who are using RTL languages and never reported something like this.

SalehAlDhobaie commented 5 years ago

Hi @maziyarpanahi This issue only appeared with System font as I know. and I find another issue if include ActiveLabel in Cells inside table view it's causing a lag in scrolling.

maziyarpanahi commented 5 years ago

I was about to say this about system fonts for RTL languages. So I close this issue as this has not related directly to the library. Feel free to open a new issue for the performance. (There is a closed issue about performance also related to the RTL language, I suggest to take a look at that maybe it helps)