android滑块选tab,「小程序UI教程」小程序滑动选择tab-view

功能

可以来回滑动得tab-view功能,小程序实现

在android ios 平台测试过,确保真实环境一致

be29231b34d7008a96a0bf6950cba409.gif

「小程序UI教程」小程序滑动选择tab-view

小程序滑动选择tab-view

如何使用

复制page下的文件夹到自己项目中

配置app.json

具体教程查看解压包demo导入说明

index.wxml"{{index}}" bindtap="handlerTabTap" class="tab {{activeTab==index?"tab-active":""}}" style="width: {{stv.windowWidth/tabs.length}}px">

{{item}}

这是第{{index+1}}个页面

index.wxss.stv-container {

position: fixed;

top: 0;

left: 0;

right: 0;

bottom: 0;

}

.withAnimate {

transition: all 100ms ease;

-webkit-transform: translate3d(0, 0, 0);

-moz-transform: translate3d(0, 0, 0);

-ms-transform: translate3d(0, 0, 0);

transform: translate3d(0, 0, 0);

-webkit-backface-visibility: hidden;

-moz-backface-visibility: hidden;

-ms-backface-visibility: hidden;

backface-visibility: hidden;

-webkit-perspective: 1000;

-moz-perspective: 1000;

-ms-perspective: 1000;

perspective: 1000;

}

.stv-container .tab-bar {

position: relative;

display: flex;

font-size: 30rpx;

color: #666666;

}

.stv-container .tab-bar .tab-active {

color: #2d80ff;

}

.stv-container .tab-bar .tab {

display: flex;

align-items: center;

justify-content: center;

padding-top: 16rpx;

padding-bottom: 20rpx;

}

.stv-container .tab-bar .under-line {

position: absolute;

bottom: 0;

height: 6rpx;

background-color: #2d80ff;

}

.stv-container .scroll-view {

position: relative;

width: 100%;

height: 100%;

background: #e7eaef;

}

.stv-container .scroll-view .scroll-view-wrapper {

position: absolute;

top: 0;

bottom: 0;

display: flex;

}

.stv-container .scroll-view .scroll-view-wrapper .one-scene {

height: 100%;

}

.one-scene text {

display: flex;

justify-content: center;

padding-top: 200rpx;

}

作者 | 时期 | 蚂蚁开源社区大神,资深开发工程师

点击了解更多-演示/下载demo源码!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值