How to change the icon in uniapp: first put the "iconfont.ttf" in the icon file into the static folder; then open "iconfont.css" and check the unicode encoding; finally fill in the encoding of the corresponding icon Just go to the text in the configuration item of "page.json".
The operating environment of this tutorial: Windows 7 system, uni-app2.5.1 version. This method is suitable for all brands of computers.
Recommended (free): uni-app development tutorial
UNI-APP adds a top navigation bar and changes the icon
uni-app is a front-end framework for developing cross-platform applications using Vue.js.
Developers write Vue.js code, and uni-app compiles it to multiple platforms such as iOS, Android, and WeChat applets to ensure that it runs correctly and achieves an excellent experience.
Record the process of replacing the top navigation bar
Final renderings
Configuration items in page.json
{ "path": "pages/my/index", "style": { "app-plus": { "titleNView": { "buttons": [{ "text": "\ue605", "fontSrc": "/static/iconfont.ttf", "fontSize": "22px", "float": "left" }, { "text": "\ue606", "fontSrc": "/static/iconfont.ttf", "fontSize": "22px" } ] } } } },
Change Icon
1. Select your favorite icon from the Alibaba vector image, and then click Favorite
Collect icons
2. Download all the icons that have been collected in the upper right corner
Download
3. Open the downloaded file in the editor, drop the iconfont.ttf in the file into the static folder, and then open iconfont.css to view the unicode encoding
unicode encoding
4. Finally, fill in the encoding of the corresponding icon into the text in the configuration item of page.json. It needs to be written as "\u***", and then restart to achieve it.
5.Finally Fill in the corresponding page life cycle method and configure different methods through e.index
onNavigationBarButtonTap:function(e){ console.log(JSON.stringify(e)) },
The above is the detailed content of How to change the icon in uniapp. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

SublimeText3 Linux new version
SublimeText3 Linux latest version

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 English version
Recommended: Win version, supports code prompts!
