iOS Code Snippet CSBuilder text direction

Discussion in 'iOS Code Snippets' started by Erel, Apr 8, 2018.

  1. Erel

    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
    Code:
    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)))
     
    MarcoRome likes this.
Loading...