Xcode中如何为App设置不同的Bundle Display Name用于设置页与图标下方?
How to Show Different Names Under App Icon vs. Settings Page in Xcode
Absolutely! This is such a common issue when you’ve got a longer app name that shines in Settings but gets cut off under the home screen icon. Luckily, Apple gives us a straightforward way to handle this with two Info.plist keys:
- First, set your full, long name for Settings: Keep using
Bundle Display Name(the underlying key isCFBundleDisplayName) for the complete title that looks great in the Settings app and Spotlight search. - Then, add a short name for the home screen: Add a new key called
Bundle name(orCFBundleNameif you’re editing the raw plist code) and set it to your concise, icon-friendly short name.
Step-by-Step in Xcode’s Visual Info.plist Editor:
- Open your project’s
Info.plistfile (usually found in your project root or Supporting Files group). - Click the
+button at the top of the editor to add a new row. - Type
Bundle nameinto the key field, then enter your short name in the value column. - Double-check that your existing
Bundle display nameis set to your full, long app name.
If You Prefer Editing the Raw Plist Code:
Replace the relevant section with something like this (swap in your actual names):
<key>CFBundleName</key> <string>ShortAppName</string> <key>CFBundleDisplayName</key> <string>My Awesome Long App Title</string>
What to Expect After Building:
- Your home screen app icon will show the short
CFBundleName(no more truncation!). - When users go to Settings > [Your App], they’ll see the full
CFBundleDisplayNamein all its glory. - Spotlight searches will also display the full name, which is perfect for users trying to find your app quickly.
If you’re dealing with localization (i.e., different names for different languages), you can localize both keys just like you would any other Info.plist entry—just add localized versions of Info.plist for each language and set the appropriate names there.
内容的提问来源于stack exchange,提问作者Adem
相关产品推荐
相关产品推荐

