我在編譯時(shí),模擬器上有顯示出圖片;
但是在手機(jī)上預(yù)覽時(shí)沒(méi)有顯示出圖片。
網(wǎng)友回復(fù):
你好,圖片是線上的圖片、代碼包里面的圖片還是下載到本地的圖片呢?
你好,圖片是在電腦本地的圖片:
麻煩提供以下相關(guān)wxml和wxss代碼。
這是我跟著網(wǎng)上的一個(gè)教程敲得,但是我這邊預(yù)覽的就是不可以。
<!--pages/aboutme/abboutme.wxml--> < view class = "about" > < view class = "about-up" > < view class = "about-img" > < image src = '{{img}}' class = 'in-img' mode = 'scaleToFill' ></ image > </ view > < view class = "about-title" >{{title}}</ view > </ view > < view class = "about-detail" > < view >{{detail1}}</ view > < view >{{detail2}}</ view > </ view > < view class = 'about-contab' > < view >{{contab}}</ view > </ view > </ view > |
/* pages/aboutme/abboutme.wxss */ .about{} .about-up{ text-align : center ;} .about-img{ display : block ; width : 160px ; height : 160px ; margin : 20px auto 0 ;} .about-title{ display : inline- block ; margin : 20px 0 ; font-size : 20px ;} .in-img{ width : 160px ; height : 160px ;} .about-detail{ text-align : center ; font-size : 16px ;} .about-contab{ text-align : center ; margin : 20px ; font-size : 14px ;} |
{{img}} 的實(shí)際值是多少?
img:"../../images/logo.PNG",
手機(jī)預(yù)覽沒(méi)顯示出來(lái),是iOS和android都顯示不出來(lái)嗎?
其它圖片可以顯示出來(lái)嗎?
直接在WXML把 {{img}} 換成 ../../images/logo.PNG 可以顯示出來(lái)嗎?
手機(jī)的ios的,Android還不知道情況。
其他圖片可以顯示,
直接在WXML把 {{img}} 換成 ../../images/logo.PNG, 也不能顯示。
麻煩把PNG換成小寫(xiě)試試?
改成小寫(xiě)之后可以了?。?!
謝謝謝謝~