欧美综合影院在线影院,国产精品女人久久久久久,日韩精品无码去免费专区,樱花草在线社区WWW日本影院

Menu
小程序資訊
小程序資訊
微信小程序把玩《三》:scroll-view組件,swiper組件,icon組件
時(shí)間:2016-10-18 18:56:00
一:scroll-view組件

scroll-view為滾動(dòng)視圖,分為水平滾動(dòng)和垂直滾動(dòng)。注意滾動(dòng)視圖垂直滾動(dòng)時(shí)一定要設(shè)置高度否則的話scroll-view不會(huì)生效。滾動(dòng)視圖常用的地方一般都是Item項(xiàng)比較多的界面,比如我的模塊

主要屬性:

使用演示:

wxml

  1. <!--垂直滾動(dòng),這里必須設(shè)置高度-->
  2. <scroll-view scroll-y="true" style="height: 200px">
  3. <view style="background: red; width: 100px; height: 100px" ></view>
  4. <view style="background: green; width: 100px; height: 100px"></view>
  5. <view style="background: blue; width: 100px; height: 100px"></view>
  6. <view style="background: yellow; width: 100px; height: 100px"></view>
  7. </scroll-view>
  8. <!-- white-space
  9. normal: 正常無(wú)變化(默認(rèn)處理方式.文本自動(dòng)處理?yè)Q行.假如抵達(dá)容器邊界內(nèi)容會(huì)轉(zhuǎn)到下一行)
  10. pre: 保持HTML源代碼的空格與換行,等同與pre標(biāo)簽
  11. nowrap: 強(qiáng)制文本在一行,除非遇到br換行標(biāo)簽
  12. pre-wrap: pre屬性,但是遇到超出容器范圍的時(shí)候會(huì)自動(dòng)換行
  13. pre-line: pre屬性,但是遇到連續(xù)空格會(huì)被看作一個(gè)空格
  14. inherit: 繼承
  15. -->
  16. <!--水平滾動(dòng)-->
  17. <scroll-view scroll-x="true" style=" white-space: nowrap; display: flex" >
  18. <!-- display: inline-block-->
  19. <view style="background: red; width: 200px; height: 100px; display: inline-block" ></view>
  20. <view style="background: green; width: 200px; height: 100px; display: inline-block"></view>
  21. <view style="background: blue; width: 200px; height: 100px; display: inline-block"></view>
  22. <view style="background: yellow; width: 200px; height: 100px; display: inline-block"></view>
  23. </scroll-view>

   

二:swiper組件

Android寫(xiě)過(guò)輪播圖的痛楚只有寫(xiě)過(guò)的知道,相對(duì)還是比較麻煩的,并沒(méi)有一個(gè)輪播圖組件,有個(gè)ViewPage也需要自己定制,iOS則多用UIScrollerView去實(shí)現(xiàn),這個(gè)swiper封裝的相對(duì)還是方便的,使用方式也相對(duì)那倆容易些。

主要屬性

屬性只需要設(shè)置就行了 也可以抽到j(luò)s文件的data中進(jìn)行數(shù)據(jù)綁定,監(jiān)聽(tīng)使用bindchange,在js中做業(yè)務(wù)處理。

wxml

  1. <!--是否顯示圓點(diǎn),自動(dòng)播放, 間隔時(shí)間, 監(jiān)聽(tīng)滾動(dòng)和點(diǎn)擊事件-->
  2. <swiper indicator-dots="true" autoplay="true" duration="1000" bindchange="listenSwiper" >
咨詢(xún)
微信掃碼咨詢(xún)
電話咨詢(xún)
400-888-9358