iOS Question Textfield : Right to Left ?

Discussion in 'iOS Questions' started by tufanv, Mar 30, 2015.

  1. tufanv

    tufanv Expert Licensed User

    Hello

    is it possible to input the text from right to left instead of default left to right ?

    TY
     
  2. narek adonts

    narek adonts Well-Known Member Licensed User

    I dont know if I understood your question correctly but try this

    Dim a As TextField
    a.TextAlignment=a.ALIGNMENT_RIGHT

    narek
     
  3. tufanv

    tufanv Expert Licensed User

    Ty for answer. I mean if i input 5281 I want textfield to show 1825 also ( i figured out how to align right with your answer ty )
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Note that even with right to left languages the numbers are still written from left to right. The input direction is switched automatically based on the keyboard language.
     
  5. narek adonts

    narek adonts Well-Known Member Licensed User

    NOT TESTED

    try this.

    Code:
    Sub myTextView_TextChanged (OldText As String, NewText As String)
    dim no as NativeObject = Me  
    no.RunMethod(
    "SetToRight:",Array(myTextView))

    End Sub

    #If OBJC

    -(void) SetToRight: (UITextField *)myTextField
    {
    [myTextField setBaseWritingDirection:UITextWritingDirectionRightToLeft forRange:[myTextField textRangeFromPosition:[myTextField beginningOfDocument] toPosition:[myTextField endOfDocument]]];
    }


    #End if
    I recommend to put Dim no as NativeObject = me in Process_Globals
     
    Last edited: Mar 30, 2015
    tufanv likes this.
  6. tufanv

    tufanv Expert Licensed User

    will try and report back Thank you !
     
  7. tufanv

    tufanv Expert Licensed User

    I tried it now . it makes the textfield start from right ty but i also need this: when i write hello it rights hello at the right but i want it to write reverse : olleh from rgiht to left is it also possible ?
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice