iOS Code Snippet CSBuilder text direction

Erel

Administrator
Staff member
Licensed User
This code adds a NSParagraphStyle to CSBuilder and changes the text direction to right to left:

cs is the CSBuilder object
B4X:
Dim no As NativeObject = cs
Dim paragraph As NativeObject
paragraph = paragraph.Initialize("NSMutableParagraphStyle").RunMethod("new", Null)
paragraph.SetField("baseWritingDirection", 1) 'NSWritingDirectionRightToLeft
no.RunMethod("addAttribute:value:range:", Array("NSParagraphStyle", paragraph, no.MakeRange(0, cs.Length)))
 
Top