Ionic - svg does not appear(离子 - svg 不出现)
问题描述
我制作了 ionic 2 sidemenu 的应用程序构建,但是 svg 出现在 Chrome 中,但 svg 在生成文件 android-debug.apk 后没有出现在 Android 中:
I made the application build of the ionic 2 sidemenu, however the svg appears in the Chrome but svg does not appear in Android after generate the file android-debug.apk:
按照我使用的命令:
npm install -g ionic cordovaionic start myApp --v2 sidemenu离子平台添加android离子构建android
/myApp/src/pages/page1/page1.html
<ion-header>
<ion-navbar>
<button ion-button menuToggle>
<ion-icon name="menu"></ion-icon>
</button>
<ion-title>Page One</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
<h3>Ionic Menu Starter</h3>
<img src="Li4vLi4vYXNzZXRzL2ltZy9teWFwcC5zdmc=" alt="IiZndDsKICAgICZsdDtwJmd0OwogICAgICAgIElmIHlvdSBnZXQgbG9zdCwgdGhlCiAgICAgICAgJmx0O2EgaHJlZj0="http://ionicframework.com/docs/v2">docs</a> will show you the way.
</p>
<button ion-button secondary menuToggle>Toggle Menu</button>
</ion-content>
你能帮我解决这个问题吗?
Could you help me solve this problem?
推荐答案
可能是因为你使用了错误的路径,记住当你构建一个应用程序时,你有这个:
Maybe it is because you use the wrong path, remember when you build an app, you have this:
所以路径需要是 "./assets/img/myapp.svg"
intread "../../assets/img/myapp.svg"
,因为在编译的应用程序中,你在 root 中,就好像你在 index.html 文件中加载了一切,它也可以在浏览器中工作
So the path is need to be "./assets/img/myapp.svg"
intread "../../assets/img/myapp.svg"
, because in a compiled app you are in the root , it's as if you are loading evething in the index.html file, and it's also works in the browser
这篇关于离子 - svg 不出现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:离子 - svg 不出现


- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01
- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01
- Android viewpager检测滑动超出范围 2022-01-01
- Android - 拆分 Drawable 2022-01-01
- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01
- 想使用ViewPager,无法识别android.support.*? 2022-01-01
- android 4中的android RadioButton问题 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01
- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- 用 Swift 实现 UITextFieldDelegate 2022-01-01