Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I specify a multiline title in an iOS Settings bundle?

I have added a Settings.bundle to my iOS application. One of my settings is a toggle switch with a long title. This title is getting truncated.

I have tried:

  1. "My Superlong\nTitle"
  2. "My Superlong
Title"

but neither worked: \n and &#xA were displayed as part of the Title. Is it possible to have a line break/newline in my title? Thanks!

like image 949
Frank Avatar asked May 03 '12 01:05

Frank


3 Answers

Yes, you can add a line return in a group title or footer:

  1. Add a new row of type Group in your Settings.bundle file
  2. Insert a new row in that group
  3. Set key name to FooterText (not available in drop down list)
  4. Set value to your long text
  5. Open Root.plist as source code (right click, Open As...)
  6. Insert 
 where a line return is needed

No, you cannot add a line return in labels attached to controls (text field, toggle switche, slider). If text is too long it's simply truncated with ellipsis… This is why you should have a very short label (for iPhone in portrait) then you can add a long description below the control using a group footer as explained above.

like image 90
rjobidon Avatar answered Nov 17 '22 23:11

rjobidon


No, you have very little control over the Settings.bundle and a multiline title is not an option. Best thing to do would be to cut down the cell title and create a group title, or group footer.

enter image description here

like image 6
WrightsCS Avatar answered Nov 18 '22 01:11

WrightsCS


I had voted @riobidon 's answer. However, I found out that 
 won't work in localization.

If you need localization, here is what you should do.

In Root.plist, use some words for place holding. For example, use "footer text" for a group footer.

Then in localization, do as below.

In en.lproj/Root.strings, add

"footer text" = "the real footer you want.\nSome other descriptions";

You can use \n in the localization.

In other languages' localization, you can do the same. No one will see "footer text", as English is the default deployment language. A user either sees what the language that you have localized, or the English as failed safe.

like image 2
Owen Zhao Avatar answered Nov 18 '22 01:11

Owen Zhao