网友真实露脸自拍10p,成人国产精品秘?久久久按摩,国产精品久久久久久无码不卡,成人免费区一区二区三区

小程序模板網

微信小程序開發問答《六十一》 輪播圖修改小點點 & 使用字體圖標 ...

發布時間:2018-04-23 11:46 所屬欄目:小程序開發教程
1、 

微信小程序 輪播圖 修改小點點

 
<pre name="code" class="html">.swiper-box .wx-swiper-dot{  
    display: inline-flex;  
    justify-content:space-between;  
    border-radius: 50%;  
}  
.swiper-box .wx-swiper-dot::before{  
    content: '';  
    flex-grow: 1;    
    background: gray;  
      border-radius: 50%;  
}  
.swiper-box .wx-swiper-dot-active::before{  
    background:white;    
      border-radius: 50%;    
}pre><br>  
<swiper class="swiper-box" indicator-dots="true" interval="3000" duration="600" style="height:500px;" current="{{num}}" > <block wx:for="{{imgs}}"> <swiper-item>  <image class="slide-image" src="{{item.src}}" width="100%">image>  
  swiper-item> block>swiper>  
<pre>pre>  
<br>  

 

2、微信小程序-使用字體圖標

使用字體圖標,教程

1.阿里font下載了后,解壓,打開iconfont.css,復制內容,粘貼到wxss文件中

2. https://transfonter.org/在這個網站上將,下載的iconfont.ttf轉換,

后下載,拷貝stylesheet.css中的內容,替換@font-face

在wxml中粘貼        111

3.然后就可以運行,看到圖標顯示了

 

3、微信小程序真機測試時導航條樣式獲取失敗?

 

在開發工具調試的時候能正常顯示,如下圖:

但是在真機調試的時候卻是全白的,如下圖:

代碼如下:
app.json下的設置

  "window": {
    "backgroundTextStyle": "light",
    "navigationBarBackgroundColor": "rgb(239,129,55)",
    "navigationBarTitleText": "投票",
    "navigationBarTextStyle": "#000"
  },

index.json下的設置

{
  "navigationBarTitleText": "投票",
  "navigationBarBackgroundColor": "rgb(239,129,55)"
}

沒有一個起作用。沮喪

第二個問題:
底部的tabBar在開發工具調試的時候能正常顯示,如下圖:

但是一到真機上就變成下圖:

代碼:

"tabBar": {
    "selectedColor": "rgb(255,40,8)",
    "backgroundColor":"#ccc",
    "color":"#000",
    "list": [
      {
        "pagePath": "pages/index/index",
        "text": "投票",
        "iconPath":"image/Rank.png",
        "selectedIconPath":"image/Money.png"
      },
      {
        "pagePath": "pages/money/money",
        "text": "錢包",
        "iconPath": "image/Money.png",
        "selectedIconPath": "image/Rank.png"
      }
    ]
  }

找不到原因~~求助~~~真的沒有人知道為什么咩~~吼苦腦

答:鐺鐺鐺,果然坑都要自己試出來。

"navigationBarBackgroundColor": "rgb(239,129,55)"
"selectedColor": "rgb(255,40,8)"

之前的顏色設置用的是rgb的形式,改成十六進制顏色碼后就好了

第一個坑和第二個坑都是一個錯誤,就是設置字的顏色上出錯了所以所有對導航條和tabbar的樣式設置都出現了問題。
還有一點需要注意的是導航欄標題顏色,僅支持 black/white
 

4、微信小程序 怎么通過data值找到元素

 

<view data-id="1">1view>
<view data-id="2">2view>
如果id = 1 ,獲取當前元素的offsetLeft值,ID是其他頁面傳過來的

答:

①小程序從1.4.0開始支持WXML節點信息API,不過不支持根據非id和class外屬性匹配,文檔描述如下:

selector類似于CSS的選擇器,但僅支持下列語法。

ID選擇器:#the-id
class選擇器(可以連續指定多個):.a-class.another-class
子元素選擇器:.the-parent > #the-child.a-class
多選擇器的并集:#a-node, .some-other-nodes

所以,你可以通過把這個ID放入id屬性或者class屬性上,然后查出來后獲取offsetLeft信息等。

具體文檔參見:https://mp.weixin.qq.com/debug/wxadoc/dev/api/wxml-nodes-info.html

 

② 通過bindtap綁定一個事件 通過事件的event參數獲取id event.currentTarget.dataset.id 判斷這個id值是否等于1就可以了。

 


易優小程序(企業版)+靈活api+前后代碼開源 碼云倉庫:starfork
本文地址:http://www.xiuhaier.com/wxmini/doc/course/23924.html 復制鏈接 如需定制請聯系易優客服咨詢:800182392 點擊咨詢
QQ在線咨詢
AI智能客服 ×