0

Background:

I faced this issue while I was implementing Localization (programatically).

Question:

I'm new to iOS development & I need your help. In my company, I've given a task to implement Localization to one of the Apps that I'm working on. I implemented Localization successfully with help from this tutorial. In my app the previous programmer had NOT used IB & Auto-Layout to develop the UI. He has done it all programatically. Now the issue is, how do I address the changing Length of the UILabels, tittles of UIbuttons ?

Solutions that I've tried:

  1. applying sizeToFit on UILabel
  2. setting setAutoresizingMask:UIViewAutoresizingFlexibleWidth

Please guys, guide me to resolve this issue. Thanks in advance.

EDIT's:

Changed the title of the question to be more generic.

Vineet
  • 161
  • 1
  • 8
  • I'd edit your subject as Localization isn't a factor here. Rather you want to constraint size based on the content. See this answer http://stackoverflow.com/questions/16009405/uilabel-sizetofit-doesnt-work-with-autolayout-ios6/19657784#19657784 – Max MacLeod Jun 09 '14 at 11:52
  • Hi @MaxMacLeod, thanks for your reply. I could get through this issue by doing the following [_myButton.titleLabel setNumberOfLines:0]; [_myButton.titleLabel setTextAlignment:NSTextAlignmentCenter]; – Vineet Jun 18 '14 at 09:45
  • that's great. If you figured it out, you can answer your own question below and mark it accepted. That will be helpful to others and also not show your question as unanswered. – Max MacLeod Jun 18 '14 at 09:52
  • @MaxMacLeod : I do not know how do I accept my answer. I read this article on stackoverflow's help center, but I dont see any kind of Check mark beside the answer toggle. May be because I don't have enough reputation points. – Vineet Jun 20 '14 at 04:28
  • Yes you need at least 15 reputation. Then after 48 hours you can accept your own answer. Once you build up more reputation you can do it later. http://stackoverflow.com/help/self-answer – Max MacLeod Jun 20 '14 at 07:39

0 Answers0