当前位置: 首页 > news >正文

项目经理证书怎么考seo难不难学

项目经理证书怎么考,seo难不难学,微网站建设教程视频教程,电商运营培训机构uniapp实现中间平滑凸起tabbar 背景实现思路代码实现尾巴 背景 在移动端开发中,tabar是一个使用频率很高的组件,几乎是每个APP都会用到。今天给大家分享一个中间平滑凸起的tabbar组件,有需要的可以做下参考。先上图镇楼: 实现思…

uniapp实现中间平滑凸起tabbar

  • 背景
  • 实现思路
  • 代码实现
  • 尾巴

背景

在移动端开发中,tabar是一个使用频率很高的组件,几乎是每个APP都会用到。今天给大家分享一个中间平滑凸起的tabbar组件,有需要的可以做下参考。先上图镇楼:
在这里插入图片描述

实现思路

看上面图片就知道这个难点只有一个,就是中间那个平滑的凸起tab怎么来实现。好了,我也不卖关子了,直接说下实现的思路:
1、先布局一个普通的tabbar
2、再利用clip-path来裁剪出一个平滑凸起的圆弧,通过设置position来盖在步骤1的普通tabbar上面。

代码实现

我们先布局出一个普通的tabbar并放置在屏幕底部。

/*省略部分代码*/
<view class="tabbar"><block v-for="(item, index) in tabbarList" :key="index"><view class="tabbar-item" @click="toIndex(index)"><image :src="current == index ? item.activeIcon : item.inactiveIcon"></image><text :class="'font-title' + (current == index ? '-active' : '')">{{item.title}}</text></view></block></view>
/*省略部分代码*/

tabbarList就是你存放的tabbar配置项为奇数个,格式如下:

/*省略部分代码*/
tabbarList: [{inactiveIcon: '../../static/tabbar/main_tab_home_normal.png',activeIcon: '../../static/tabbar/main_tab_home_select.png',title: '首页'}]
/*省略部分代码*/

这是效果如下:
在这里插入图片描述
接下来我们利用clip-path来裁剪出一个弧形的path,然后在tabbar中间盖一个你需要的图片,我这里是加号图。为了看的更直观,我将这个裁剪的弧形先不盖在tabbar上面,先偏移底部较大一段距离,看效果:
在这里插入图片描述
然后调整下偏移量到一个合适位置,就看到了文章中开始那个效果了。这个path的裁剪形状你可以直接参考我的。

/*省略部分代码*/
.mid-btn-arc {position: fixed;bottom: 250rpx;left: calc(50% - 100rpx);background-color: #fff;z-index: 98;height: 100rpx;width: 200rpx;clip-path: path('M 50,0 Q 35,0 25,7.5 Q 20.5, 11.5 0, 15 V 50 H 100 V15 Q 79.5,11.5 75,7.5 Q 65,0 50,0 z');}
/*省略部分代码*/

到这里基本就完工了。接下来贴出来全部的代码:

<template><view><view>{{content}}</view><view class="tabbar"><block v-for="(item, index) in tabbarList" :key="index"><view class="tabbar-item" @click="toIndex(index)"><image :src="current == index ? item.activeIcon : item.inactiveIcon"></image><text :class="'font-title' + (current == index ? '-active' : '')">{{item.title}}</text></view></block><view class="mid-btn-arc"></view><view class="mid-btn" @click="toIndex(tabbarList.length % 2)"><image class="mid-img" src="../../static/tabbar/add.png"></image></view></view></view>
</template><script>export default {data() {return {current: 0,content: '首页',tabbarList: [{inactiveIcon: '../../static/tabbar/main_tab_home_normal.png',activeIcon: '../../static/tabbar/main_tab_home_select.png',title: '首页'},{inactiveIcon: '../../static/tabbar/main_tab_home_normal.png',activeIcon: '../../static/tabbar/main_tab_home_select.png',title: '首页1'},{inactiveIcon: '../../static/tabbar/main_tab_home_normal.png',activeIcon: '../../static/tabbar/main_tab_home_select.png',title: '首页2'},{inactiveIcon: '../../static/tabbar/main_tab_home_normal.png',activeIcon: '../../static/tabbar/main_tab_home_select.png',title: '首页3'},{inactiveIcon: '../../static/tabbar/main_tab_home_normal.png',activeIcon: '../../static/tabbar/main_tab_home_select.png',title: '首页4'}]}},methods: {toIndex(index){this.current = indexthis.content = this.tabbarList[index].title}}}
</script><style lang="scss">page {background-color: #dfdfdf;}.tabbar {position: fixed;left: 0;bottom: 0;height: 120rpx;width: 100vw;background-color: #f9f9f9;z-index: 99;display: flex;justify-content: space-between;align-items: center;}.tabbar-item {flex: 1;height: 120rpx;background-color: #fff;z-index: 100;display: flex;flex-direction: column;justify-content: center;align-items: center;transition: transform 0.3s;}.font-title {font-size: 22rpx;margin: 5rpx 0;color: #dfdfdf;z-index: 100;}.font-title-active {font-size: 22rpx;margin: 5rpx 0;color: #000000;z-index: 100;}.mid-btn-arc {position: fixed;bottom: 50rpx;left: calc(50% - 100rpx);background-color: #fff;z-index: 98;height: 100rpx;width: 200rpx;clip-path: path('M 50,0 Q 35,0 25,7.5 Q 20.5, 11.5 0, 15 V 50 H 100 V15 Q 79.5,11.5 75,7.5 Q 65,0 50,0 z');}.mid-btn {position: fixed;height: 100rpx;width: 100rpx;left: 50%;bottom: 45rpx;transform: translateX(-50rpx);background-color: #fff;border-radius: 50rpx;display: flex;justify-content: center;align-items: center;z-index: 100;.mid-img {width: 80rpx;height: 80rpx;}}image {width: 50rpx;height: 50rpx;transition: transform 0.3s, width 0.3s, height 0.3s;}
</style>

我知道你只想直接ctrl+c在这里插入图片描述

啊什么,你还想要图片?给你,通通给你:
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

尾巴

毫无保留啥都给你们了,有啥问题可以给我留言,如果喜欢我的文章,欢迎给我点赞,评论,关注,谢谢大家!

http://www.hkea.cn/news/200023/

相关文章:

  • 低价网站公司软文怎么写
  • 东莞市建设公共交易中心网站百度官网首页
  • 如何建立的网站能争钱优化营商环境 助推高质量发展
  • 做百度网站营销型网站建设排名
  • 网站域名被黑国际新闻最新消息战争
  • 苏州网站开发公司济南兴田德润厉害吗网络自动推广软件
  • 广药网站建设试卷株洲最新今日头条
  • 网站建设管理考核办法微信推广平台怎么做
  • 网站新闻模块代码网络推广有哪些常见的推广方法
  • 合肥大型网站如何推广普通话
  • 高端网站制作软件怎么样推广自己的店铺和产品
  • 无障碍浏览网站怎么做关键词seo排名优化推荐
  • wordpress 247seo推广系统
  • 做深圳门户网站起什么名字好泰州seo外包公司
  • 网站视频上传怎么做百度站长平台论坛
  • wordpress农业模板下载小时seo
  • 做网站语言排名2018发帖推广哪个平台好
  • 销氪crmseo入门讲解
  • 蒙阴哪有做淘宝网站的钓鱼网站制作教程
  • 网站如何做导航条下拉菜单怎么做百度网页
  • 网站开发都做什么平台推广精准客源
  • 网站建设共享ip宁波seo搜索引擎优化
  • 学校网站建设必要性搜索引擎排名
  • 哪里有做区块链网站的百度网址大全在哪里找
  • 加盟平台网站怎么做竞价托管多少钱一个月
  • wordpress 微信 代码网站关键词怎么优化排名
  • 网站推广维护考研培训班哪个机构比较好
  • 网站后台生成器人工智能培训班收费标准
  • 在线做app的网站武汉网络营销公司排名
  • 了解深圳网站页面设计潍坊百度关键词优化