Wednesday 15 July 2015

UITextField Max Length in C# with Xamarin.iOS -


I would like to set a threshold for the number of characters that enter an iOS app for 25 apps in a UITfield. can be done . According to

, this can be done in Objective-C:

  - (BOOL) textField: (UITextField *) textField shouldChangeCharactersInRange: (NSRange) category replacement string : (NSString *) string {NSUInteger newLength = [textField.text length] + [string length] - range.line; Return (new llanation 25)? No yes; }   

I'm Camerin How can I do the same thing in C # with iOS?

This test has not been done, but I believe it can work:

  UITFieldfield Myfield; MyField.ShouldChangeCharacters = (textField, Category, Replacement String) = & gt; {Var newLength = textField.Text.Length + Replace String.Length - range.Length; Return to new length & lt; = 25; };    

No comments:

Post a Comment