Sub JustifyRTL (cs As CSBuilder) As CSBuilder
Dim ParaStyle As NativeObject
ParaStyle = ParaStyle.Initialize("NSMutableParagraphStyle").RunMethod("alloc",Null).RunMethod("init",Null)
ParaStyle.SetField("alignment",3) 'JUSTIFY
ParaStyle.SetField("baseWritingDirection", 1) 'RIGHT_TO_LEFT
cs.As(NativeObject).RunMethod("addAttribute:value:range:", Array("NSParagraphStyle", ParaStyle, cs.As(NativeObject).MakeRange(0, cs.Length)))
Return cs
End Sub
Note that it will override the center alignment that you set in the CSBuilder. You can modify the range, MakeRange(0, cs.Length) to make it skip the beginning.
Note that it will override the center alignment that you set in the CSBuilder. You can modify the range, MakeRange(0, cs.Length) to make it skip the beginning.