微信小程序 兩種滑動方式(橫向滑動,豎向滑動)詳細及實例代碼
更新時間:2017年01月13日 11:18:06 投稿:lqh
這篇文章主要介紹了微信小程序 兩種滑動方式詳細及實例代碼的相關(guān)資料,這里對橫向滑動和豎向滑動都做介紹,需要的朋友可以參考下
微信小程序 滑動方式
豎向滑動:
<scroll-view scroll-y="true" style="height: 200rpx;"> <view style="background: red; width: 200px; height: 100px; display: inline-block" ></view> <view style="background: green; width: 200px; height: 100px; display: inline-block"></view> <view style="background: blue; width: 200px; height: 100px; display: inline-block"></view> <view style="background: yellow; width: 200px; height: 100px; display: inline-block"></view> </scroll-view>
橫向滑動:
<!-- white-space--> normal: 正常無變化(默認處理方式.文本自動處理換行.假如抵達容器邊界內(nèi)容會轉(zhuǎn)到下一行) pre: 保持HTML源代碼的空格與換行,等同與pre標(biāo)簽 nowrap: 強制文本在一行,除非遇到br換行標(biāo)簽 pre-wrap: 同pre屬性,但是遇到超出容器范圍的時候會自動換行 pre-line: 同pre屬性,但是遇到連續(xù)空格會被看作一個空格 inherit: 繼承
水平滾動
<scroll-view scroll-x="true" style=" white-space: nowrap; display: flex" > <view style="background: red; width: 200px; height: 100px; display: inline-block" ></view> <view style="background: green; width: 200px; height: 100px; display: inline-block"></view> <view style="background: blue; width: 200px; height: 100px; display: inline-block"></view> <view style="background: yellow; width: 200px; height: 100px; display: inline-block"></view> </scroll-view>
感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!
相關(guān)文章
package.json中browser?module?main字段優(yōu)先級對比
這篇文章主要介紹了package.json中browser?module?main字段的優(yōu)先級詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪2023-07-07Javascript中bind()方法綁定函數(shù)的使用與實現(xiàn)
這篇文章主要為大家介紹了Javascript中bind()方法綁定函數(shù)的使用與實現(xiàn)示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪2023-06-06微信小程序 后臺https域名綁定和免費的https證書申請詳解
這篇文章主要介紹了微信小程序 后臺https域名綁定和免費的https證書申請詳解的相關(guān)資料,需要的朋友可以參考下2016-11-11