layui选项卡嵌套选项卡_在ProtoPie中使用嵌套组件构建选项卡栏

本文介绍了如何在layui框架下实现选项卡的嵌套功能,并探讨了在ProtoPie交互设计工具中使用嵌套组件来构建灵活的选项卡栏,为用户提供更丰富的交互体验。
摘要由CSDN通过智能技术生成

layui选项卡嵌套选项卡

One of the powerful features of ProtoPie is the ability to build fully portable and interactive UI components. We are going to make use of nested components, SVG icons, and layout constraints to build a tab bar UI component that is self-contained and flexible enough to reuse in any future project.

ProtoPie的强大功能之一是能够构建完全可移植的交互式UI组件。 我们将利用嵌套的组件,SVG图标和布局约束来构建选项卡式UI组件,该组件是独立的并且足够灵活,可以在以后的任何项目中重复使用。

01.导入SVG图标 (01. Importing the SVG icons)

I’m using the following icons downloaded from Feather icons. To follow along download Home, Activity, Bell, and Settings.

我正在使用从Feather图标下载的以下图标 。 要继续下载家庭,活动,铃声和设置。

The imported icons from Feather Icons
The 4 SVG’s imported
4款SVG的进口
  1. Import your icons via Image import. You can shift-select and import them all in one go if you like

    通过Image import导入图标。 如果愿意,您可以一次选择并导入所有内容

  2. Currently, There’s a bug in ProtoPie which causes the icons to import at a smaller size so let’s fix that (not the bug obviously!). Taking each icon, in turn, make them 24 px (check that the padlock icon is locked to preserve the aspect ratio)

    当前,ProtoPie中存在一个错误,该错误会导致图标以较小的尺寸导入,因此让我们对其进行修复(显然不是该错误!)。 依次将每个图标设为24像素 (检查挂锁图标是否已锁定以保持宽高比)

  3. Select the first icon and tap Convert to Shape (you’ll find this under the image preview in the top right)

    选择第一个图标,然后点击“ 转换为形状” (您会在右上角的图像预览下找到它)

  4. Choose a border color for your icon (I chose #228BE6)

    为图标选择边框颜色(我选择了#228BE6 )

  5. Repeat for 3 more icons

    重复3个以上的图标
  6. Organize the icons in the layer panel with your left most icon being at the top and the right-most icon at the bottom. The order I’m using is Home, Activity, Bell, Settings

    在图层面板中组织图标,最左边的图标在顶部,最右边的图标在底部。 我使用的顺序是家庭,活动,响铃,设置
  7. Position the icons roughly in the tab bar location across the bottom of the screen

    将图标大致放置在屏幕底部的标签栏位置
Image for post
Tap convert to shape for each SVG icon
点击转换为每个SVG图标的形状

02.创建选项卡 (02. Creating the tabs)

We are going to have 4 tab items that will link to 4 separate scenes. Let’s create the Home tab first.

我们将有4个选项卡项目,它们将链接到4个单独的场景。 首先创建“ 主页”选项卡。

  1. Use the Shape menu to create a rectangle (or press R on your keyboard) and make it 56 px high. Type 25% in the width field to get a width exactly one-quarter of the width of your prototype; The value will be converted to pixels for you.

    使用“形状”菜单创建一个矩形(或按键盘上的R)并将其设为56 px高。 在width字段中输入25% ,以获得正好等于原型宽度四分之一的宽度; 该值将为您转换为像素。

  2. Move the rectangle into the bottom left of your screen until it snaps into place and positions it under the home icon layer.

    将矩形移到屏幕的左下方,直到其固定到位并将其放置在主图标层下。
  3. Move the Home icon into the center of the rectangle so it is both vertically and horizontally centered. You will know when it’s in the center when you see the red alignment lines or you could use the alignment tools located in the top right of the screen above the image preview window; to do this select both the rectangle and the Home icon and select the center horizontal and vertical

    将主屏幕图标移到矩形的中心,使其在垂直和水平方向上居中。 当您看到红色的对齐线时,您将知道它何时位于中心,或者您可以使用图像预览窗口上方屏幕右上方的对齐工具; 为此,选择矩形和“主页”图标,然后
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Vue选项卡的蓝色下划线可以通过设置边框颜色来实现。首先,选择一个边框颜色作为蓝色,比如我选择了#228BE6作为蓝色。这个边框颜色可以在设置自定义。 接下来,我们需要设置一些约束,以便选项卡可以扩展到任何大小。在“图层”面板选择tab组件,然后在界面右侧的属性面板找到约束。约束分为3个框,左边的框是管脚约束,右上方的框和右下方的框是尺寸约束。关闭所有约束,因为我们不想在此处应用任何约束。 然后,选择图标,我们仍然要保持它的宽高比,因此保持尺寸约束打开,但移除所有的管脚约束。如果现在拖动右间的手柄,你应该可以看到你有一个灵活的选项卡。 对于下划线的样式,可以通过控制颜色来实现。element-ui通过一个独立的元素实现选项卡间切换,因此我们可以将下划线独立为一个元素。可以设置下划线的边框颜色为渐变色,左右两边的颜色透明,间段的颜色为蓝色。可以通过设置渐变位置的百分比来控制渐变效果。这样就能实现蓝色下划线的效果。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [layui选项卡嵌套选项卡_在ProtoPie使用嵌套组件构建选项卡](https://blog.csdn.net/weixin_26732881/article/details/108135407)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *3* [关于修改element-uiTabs标签页选标签下划线缩短居效果的实现方法](https://blog.csdn.net/csdn6107/article/details/126162729)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值