微信小程序瀑布流列表

小程序的瀑布流列表,如果是兩列,把屏幕分為2列,左邊一列,右邊一列。

<!-- <view class='waterfall'> --> 


  <!-- 左邊 -->
  <!-- <view class='left'>
    <view wx:for="{{Arr1}}" wx:key="imgid" bindtap='tapAction'>

      <image src="{{item.pic}}" mode="widthFix"></image>
      <icon class='number'>{{index + 1}}</icon>
      <textview class='title'>{{item.name}}</textview>
      <textview class='subTitle'>{{item.remark}}</textview>
    </view>
  </view> -->

  <!-- 右邊 -->
  <!-- <view class='right'>
    <view wx:for="{{Arr2}}" wx:key="imgid">
      <image src="{{item.pic}}" mode="widthFix"></image>
      <textview class='title'>{{item.name}}</textview>
      <textview class='subTitle'>{{item.remark}}</textview>
    </view>
  </view>

</view> -->

在wxss里面,定義各個(gè)view的位置。

.waterfall .left {

  margin-left: 2%;
  width: 48%;
  display: inline-block;
  vertical-align: top;
  /* background-color: red; */
}
.waterfall .right {
 margin-right: 2%;
  width: 48%;
  display: inline-block;
  vertical-align: top;
  /* background-color: green; */
  white-space:pre-line;
}

.waterfall .title{
  margin-top: 0;
  margin-left: 10%;
  width: 80%;
  height: 100rpx;
  font-size: 24rpx;
  display: flex;
 flex-direction: column;
  justify-content: center;
  align-items: center;
    text-align: center;
  color:black;
  word-break: break-all;

 
}
.waterfall .subTitle{
   margin-top: 0;
  margin-left: 10%;
  width: 80%;
  box-sizing: border-box;

  height: 150rpx;
 font-size: 24rpx;
    display: flex;
  justify-content: center;
    text-align: center;
  color: #666666;
  word-break: break-all;

}

image{
  
  margin-left: 15%;
  width: 70%;
  height: 0;
  margin-top: 0;
  display: inline-block;
}



?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容