I’m excited to share a set of mobile apps I’ve recently completed and published on both the Google Play Store and the Apple App Store. These apps are designed with a simple goal in mind: to make meaningful, structured content more accessible, whether you’re studying theology or improving your English vocabulary. 📱 Now Available on Both Platforms All apps are live and available for download: Google Play Developer Page: https://play.google.com/store/apps/dev?id=5835943159853189043 Apple App Store Developer Page: https://apps.apple.com/ca/developer/q-z-l-corp/id1888794100 📖 Theology & Confession Study Apps For those interested in Reformed theology and classical Christian teachings, I’ve developed a series of apps that present foundational texts in a clean, focused reading format: The Belgic Confession Canons of Dort Heidelberg Catechism Westminster Shorter Catechism Each app is designed to provide a distraction-free experience, making it easier to read, reflect, and revisit these im...
React Native iOS 修复:MaterialIcons 显示 “?”(字体未加载问题完整解决方案)
- Get link
- X
- Other Apps
By
Errong Leng
-
React Native iOS 修复:MaterialIcons 显示 “?”(字体未加载问题完整解决方案)
如果你的 React Native 应用在 iOS 上显示 ? 而不是 MaterialIcons 图标,通常是因为 iOS 没有正确加载图标字体导致的。
本文将讲解:
- 问题出现的原因
- 完整修复方法
- 常见坑:Multiple commands produce MaterialIcons.ttf
问题现象
你可能在代码中使用:
import MaterialIcons from '@react-native-vector-icons/material-icons';
并这样渲染图标:
<MaterialIcons name="dashboard" size={24} color="#2563eb" />
但在 iOS 上出现:
- 显示
? - 图标为空白
- 图标无法显示
根本原因
问题的核心是 MaterialIcons.ttf 没有被正确加载到 iOS App Bundle 中。
在 iOS 中,字体必须满足:
- 被加入 App 资源文件
- 在
Info.plist中注册
如果缺少任何一步,iOS 就无法渲染字体图标,只会显示 ?。
解决方案(推荐做法)
第一步:在 Info.plist 注册字体
打开文件:
ios/<YourAppName>/Info.plist
添加以下内容:
<key>UIAppFonts</key>
<array>
<string>MaterialIcons.ttf</string>
</array>
如果已经存在 UIAppFonts,只需追加:
<string>MaterialIcons.ttf</string>
第二步:清理并重新构建 iOS 项目
修改 Info.plist 后必须重新编译 App。
方法一:Xcode
- Product → Clean Build Folder
- 删除模拟器或真机上的 App
- 重新运行
方法二:命令行
npm run ios
如果问题仍然存在:
rm -rf ~/Library/Developer/Xcode/DerivedData
然后再次重新构建。
常见问题:Multiple commands produce MaterialIcons.ttf
你可能会看到以下错误:
Multiple commands produce ... MaterialIcons.ttf
原因
字体被重复复制了:
- Xcode Build Phases(Copy Bundle Resources)
- CocoaPods 自动复制资源
解决字体重复复制问题
必须确保 只有一个来源 复制字体文件。
方案一(推荐)
如果 CocoaPods 已经处理字体:
删除:
Build Phases → Copy Bundle Resources
中的 MaterialIcons.ttf
方案二
如果你手动管理字体:
- 确保 CocoaPods 没有重复复制
修复后:
- Clean Build
- 重新运行 App
为什么 iOS 比 Android 更容易出现这个问题
iOS 对资源管理更严格:
- 必须在 Info.plist 中注册字体
- 必须正确打包到 App Bundle
- 没有 Android 那种自动字体 fallback
任何一步遗漏都会导致图标显示 ?。
快速检查清单
- ✔ 项目中存在 MaterialIcons.ttf
- ✔ Info.plist 中有 UIAppFonts
- ✔ UIAppFonts 中已添加字体
- ✔ Xcode 没有重复字体拷贝
- ✔ 已清理并重新构建
最终正确代码
import MaterialIcons from '@react-native-vector-icons/material-icons';
<MaterialIcons name="dashboard" size={24} color="#2563eb" />
注意:代码本身没有问题,问题在于 iOS 原生字体加载配置。
总结
如果 iOS 上 MaterialIcons 显示 ?:
- 在 Info.plist 中注册 MaterialIcons.ttf
- 避免 Xcode / CocoaPods 重复复制字体
- 清理并重新构建项目
完成以上步骤后,图标即可在 iOS 正常显示。
❤️ Support This Blog
If this post helped you, you can support my writing with a small donation. Thank you for reading.
CocoaPods
Code
iOS
ios字体问题
ios构建错误
ios调试
materialicons
materialicons不显示
React Native
react native ios修复
uiappfonts
Xcode
向量图标
字体未加载
- Get link
- X
- Other Apps
Popular Posts
Fix up watchman issue with Ghost
By
三好Daddy
-
# Issue >> >> at BunserBuf.<anonymous> (/home/errong_leng/Ghost/core/client/node_modules/fb-watchman/index.js:95:23) >> at emitOne (events.js:116:13) >> at BunserBuf.emit (events.js:211:7) >> at BunserBuf.process (/home/errong_leng/Ghost/core/client/node_modules/bser/index.js:292:10) >> at /home/errong_leng/Ghost/core/client/node_modules/bser/index.js:247:12 >> at _combinedTickCallback (internal/process/next_tick.js:131:7) >> at process._tickCallback (internal/process/next_tick.js:180:9) >> A non-recoverable condition has triggered. Watchman needs your help! >> The triggering condition was at timestamp=1509698956: inotify-add-watch(/home/errong_leng/Ghost/core/client/node_modules/ember-cli-node-assets/node_modules/broccoli-funn...
Using Mutual TLS (mTLS) in Next.js (Server-Side Only)
By
三好Daddy
-
Using Mutual TLS (mTLS) in Next.js (Server-Side Only) In the previous posts, we covered: Part 1: Making mTLS API requests from Node.js clients Part 2: Enabling mTLS in Node.js servers Now we focus on Next.js applications and how mTLS works depending on deployment. Next.js Cannot Access TLS Handshake Directly Next.js middleware and API routes run after the TLS handshake They cannot see client certificates or verify them Next.js built-in server does not expose Node's HTTPS options like requestCert In short: Next.js middleware cannot enforce mTLS or access TLS handshake details . Any enforcement must happen before the request reaches Next.js. Next.js as an mTLS Client (Server-Side API Calls) Next.js can securely call mTLS-protected APIs from server-side code, such as: API routes Server actions import fs from 'fs'; import https from 'https'; import axios from 'axios'; export async function GET(req) { const...
Cross compile tensorflow for armv7l targets via bazel
By
三好Daddy
-
Comments
Post a Comment