When using uniapp for Android development, sometimes you will encounter the problem that the css style cannot be found. This situation can mess up your development process, so we need to know why it happens and how to fix it.
Cause of the problem:
If this situation also occurs in your uniapp project, please see the following solution:
If you use flex layout, you can avoid many problems that cannot be found in this style. In addition, it can also make the page layout more flexible. For example:
.flexBox{ display: -webkit-box; display: -webkit-flex; display: flex; -webkit-box-orient: horizontal; -webkit-box-direction: normal; -webkit-flex-direction: row; flex-direction: row; -webkit-box-align: center; -webkit-align-items: center; align-items: center; }
Using rem relative units can also avoid this problem very well, scaling equally on different screens, the ratio is 1rem= 100 pixels.
Android compatibility issues are very common, you can add specific prefixes to CSS styles for compatibility (for example: -webkit, -ms, etc.) .
In addition, sometimes it is necessary to introduce some CSS preprocessors, such as Less, Sass, etc.
To sum up, it is a common problem that uniapp’s Android css cannot be found, but we can solve this problem by using flex layout, using rem relative units, and adding specific prefixes. Improve development efficiency. When developing uniapp, avoid using some less popular CSS properties to prevent incompatibility issues.
The above is the detailed content of What should I do if uniapp Android css cannot be found?. For more information, please follow other related articles on the PHP Chinese website!