iOS Code Snippet make datepicker Chinese style

Discussion in 'iOS Code Snippets' started by icefairy333, Nov 10, 2016.

  1. icefairy333

    icefairy333 Active Member Licensed User

    Code:
    '将datepicker设置成中文版
    Private Sub setdatepickerch(dp As DatePicker)
        
    Dim jo As NativeObject
        jo=Me
        jo.RunMethod(
    "setdploc:",Array(dp))
    End Sub
    #if OBJC
    - (void) setdploc:(UIDatePicker*)datePicker{
        NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:@"zh_CN"];//设置为中文
        datePicker.locale = locale;
    }
    #end if
     
    Carlos Huerta, TWCoder and Erel like this.
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