如何将UIApplicationShortcutItems图标设置在文本左侧?
Great question! I’ve wrestled with this exact discrepancy between Apple’s default behavior and popular third-party apps like Facebook and Snapchat. Here’s the breakdown of what’s going on and how you can replicate that left-aligned icon look:
Why the Default Alignment is Right
First, let’s clarify: Apple’s system-level Home Screen Quick Actions default to right-aligned icons in left-to-right (LTR) languages (like English, Chinese, etc.). In right-to-left (RTL) languages (Arabic, Hebrew), icons automatically shift to the left. This is baked into the system’s UI design, which is why you see it in Apple’s official apps and documentation.
How Third-Party Apps Do Left-Aligned Icons
Apps like Facebook and Snapchat don’t rely on the system’s default icon placement—they use a clever workaround to get icons on the left:
- Skip the system icon field entirely: Instead of setting
UIApplicationShortcutIconTypeorUIApplicationShortcutIconFilein your Info.plist or code, embed your icon directly into the shortcut’s title text.- Use a custom icon font: Create a font file that includes your shortcut icons as glyphs, then insert the corresponding character at the start of your
UIApplicationShortcutItemTitlestring. - Use emoji-style icons: If your icon is simple enough, you can use a matching emoji or custom Unicode symbol (though this limits design flexibility).
- Use a custom icon font: Create a font file that includes your shortcut icons as glyphs, then insert the corresponding character at the start of your
- Adjust spacing: Add a small amount of padding (like a space or two) between the embedded icon and the text to mimic the system’s natural spacing.
Is There an Official Way to Shift System Icons Left?
Unfortunately, Apple does not provide an official API or setting to change the default icon alignment for UIApplicationShortcutItems. The system controls this layout based on language direction, and there’s no supported way to override it without breaking system design conventions.
The workaround above is the only reliable way to get that left-aligned icon look that matches popular third-party apps. Just keep in mind that this means you won’t get the system’s automatic icon scaling or template tinting—you’ll have to handle those details yourself in your custom icon font or symbol.
内容的提问来源于stack exchange,提问作者Mehdi S.

