开发者

Adjust Text Field Size Based on current language iOS

Is it possi开发者_如何学运维ble to dynamically set the size of a text field, button or other visual atributes based on the current user selected language?

Code sample would be great! Thanks for the help


You can easily adjust the size of a text field, for example depending on the text it contains.

NSString *localizedText; 
textField.text = localizedText;
[textField sizeToFit];
textField.text = @"";

You can generate localizedText dynamically with methods such as stringFromDate etc. or keep an NSDictionary with appropriate strings and the locales as keys.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜