S shashkiranr Active Member Licensed User Longtime User Feb 12, 2016 #1 Hi All, I Know CRLF corresponds to Chr(10) new line height. I want the height to be reduced by half. Is there any way it can be done? Kindly let me know. Best, SK
Hi All, I Know CRLF corresponds to Chr(10) new line height. I want the height to be reduced by half. Is there any way it can be done? Kindly let me know. Best, SK
Erel B4X founder Staff member Licensed User Longtime User Feb 14, 2016 #2 You are confusing different things. Chr(10) is the new line character. It doesn't have anything to do with the actual line height. There is no "half line" character. Upvote 0
You are confusing different things. Chr(10) is the new line character. It doesn't have anything to do with the actual line height. There is no "half line" character.
S shashkiranr Active Member Licensed User Longtime User Feb 14, 2016 #3 Sorry for posting in wrong thread. I found another way to get it working. B4X: Dim jo = TitleLabel As JavaObject Dim f1,f2 As Float f1 = 1 f2 = 1.5 jo.RunMethod("setLineSpacing", Array As Object(f1,f2)) So if the title lable text has a CRLF then it will be more than single line height. Best, SK Upvote 0
Sorry for posting in wrong thread. I found another way to get it working. B4X: Dim jo = TitleLabel As JavaObject Dim f1,f2 As Float f1 = 1 f2 = 1.5 jo.RunMethod("setLineSpacing", Array As Object(f1,f2)) So if the title lable text has a CRLF then it will be more than single line height. Best, SK
S shashkiranr Active Member Licensed User Longtime User Feb 29, 2016 #4 Hi Erel, MeasureMultilineTextHeight is not working properly after using the above setLineSpacing on a label. Any Idea how to overcome it Best, SK Upvote 0
Hi Erel, MeasureMultilineTextHeight is not working properly after using the above setLineSpacing on a label. Any Idea how to overcome it Best, SK
Erel B4X founder Staff member Licensed User Longtime User Feb 29, 2016 #5 StringUtils.MeasureMultilineTextHeight assumes that the default spacing is used. Try to multiply the result. The change is probably linear (or close to linear). Upvote 0
StringUtils.MeasureMultilineTextHeight assumes that the default spacing is used. Try to multiply the result. The change is probably linear (or close to linear).
S shashkiranr Active Member Licensed User Longtime User Mar 1, 2016 #6 Yes it worked. Multiplied the height by f2 value. Upvote 0