sketch浮动布局_使用智能布局和调整大小在Sketch中创建更好的可重用符号

sketch浮动布局

Sketch is a widely used tool for UI designs. It implemented the

Sketch是用于UI设计的广泛使用的工具。 它实施了

atomic design methodology and made the workflow of UI design much more efficient. You can create a Symbol in Sketch and use it everywhere in your design, which gives you a great advantage to keep “a single source of truth. “原子设计方法,并使UI设计的工作流程更加高效。 您可以在Sketch中创建一个Symbol并将其在设计中的任何地方使用,这为您保持“单一事实来源”提供了很大的优势。 “

However, it’s painful to create a slightly complex Symbol before Sketch introduced the Smart Layout and Resizing features. All Sketch users experienced how the contents inside a symbol were stretched not as intended and had to “detach” it. In this article, I want to share my experience of creating better Symbols to gain more flexibility and reduce the detaching.

但是,在Sketch引入智能布局和调整大小功能之前,创建一个稍微复杂的Symbol是很痛苦的。 所有Sketch用户都体验了如何将符号内的内容拉伸到超出预期的程度,并不得不“分离”该符号。 在本文中,我想分享我创建更好的Symbols的经验,以获得更多的灵活性并减少分离。

引入智能布局 (Introducing Smart Layout)

Smart Layout is a feature introduced in Sketch 58. You can select the Layout when you create a Symbol. Smart Layout gives you more possibility to customize the Symbols for different Scenarios.

Smart Layout是Sketch 58中引入的功能。创建符号时可以选择Layout。 智能布局使您可以为不同的场景自定义符号。

Let’s take a navigation menu for example. First, I created a simple Symbol called “Menu item” and then used it in another “Menu” Symbol:

让我们以一个导航菜单为例。 首先,我创建了一个名为“菜单项”的简单符号,然后在另一个“菜单”符号中使用了它:

Menu example

For the “Menu” Symbol I applied the horizontal “Left to Right Layout”:

对于“菜单”符号,我应用了水平的“从左到右布局”:

Layout options in the sidebar

When I use the “Menu” Symbol in the page design, I can easily hide one element in it and the following elements will be automatically “pulled”:

当我在页面设计中使用“菜单”符号时,我可以轻松地在其中隐藏一个元素,随后的元素将被自动“拉出”:

The animation of hiding one Symbol in the layout.

It’s often that different pages on the same website have different navigation items. With Smart Layout you can design a menu with all possible items and hide the unnecessary ones in different scenarios.

同一网站上的不同页面通常具有不同的导航项。 使用Smart Layout,您可以设计一个包含所有可能项目的菜单,并在不同情况下隐藏不必要的菜单。

To learn more about Smart Layout, you can visit this page on Sketch’s website.

要了解有关智能布局的更多信息,请访问Sketch网站上的此页面 。

调整大小简介 (Introducing Resizing)

Resizing is a feature to control the positioning and stretching of the element when its parent (a Symbol or a Group) get resized. There are two options: “Pin to Edge” and “Fix Size”:

调整大小是一项功能,可以在调整其父项(符号或组)的大小时控制元素的位置和拉伸。 有两个选项:“ Pin to Edge”和“ Fix Size”:

Resizing options.

With these two options you can make an element stay in its position or keep its size while its parent element get stretched.

使用这两个选项,可以使元素保持其位置或在其父元素被拉伸时保持其大小。

Let’s say you have a simple button with an icon. The icon will be resized according to the button if you don’t set up the Resizing:

假设您有一个带有图标的简单按钮。 如果您未设置调整大小,则图标将根据按钮调整大小:

Stretching with distortion.

To fix this we can make the icon pin to top-left and keep its size:

为了解决这个问题,我们可以将图标固定在左上角并保持其大小:

Symbol with fix size

Here is the result:

结果如下:

Stretching without distortion.

结合智能布局和调整大小 (Combining Smart Layout and Resizing)

Smart Layout plus Resizing can help you create powerful and configurable components and dramatically ease the pain of maintaining a design system.

智能版式和调整大小可以帮助您创建功能强大且可配置的组件,并大大减轻维护设计系统的麻烦。

Now let’s try to create a notification component which could contain

现在让我们尝试创建一个通知组件,其中可能包含

  1. an indicator icon, a “close” button, or a “Dismiss” link.

    指示器图标,“关闭”按钮或“关闭”链接。
  2. multiple-line text.

    多行文字。

As you can see in this image:

正如您在此图中看到的:

Notification component preview.

Yes, we can do it with just one Symbol!

是的,我们只用一个符号就能做到!

First, we have to create simple Symbols for the “info” button, the “close” button, and the “Dismiss” link so we can hide them if it’s necessary, because we can only hide Symbols in Sketch.

首先,我们必须为“信息”按钮,“关闭”按钮和“关闭”链接创建简单的符号,以便在必要时可以将其隐藏,因为我们只能在Sketch中隐藏符号。

After that we can set up the Resizing for each element:

之后,我们可以为每个元素设置“调整大小”:

  1. “info” button: Fixed width, Fixed height, Pin to top-left.

    “信息”按钮: 固定宽度,固定高度,固定在左上角。

  2. “close” button and “Dismiss” link: Fixed width, Fixed height, Pin to top-right

    “关闭”按钮和“关闭”链接: 固定宽度,固定高度,固定在右上角

The text content part is a little bit tricky. You have to first select the “Fixed Size” in the Alignment section:

文本内容部分有些棘手。 您必须先在“对齐”部分中选择“固定大小”:

Text size options

Then under Resizing unselect all “Fix Size” and make it pin to all four edges:

然后在“调整大小”下取消选择所有“固定大小”,并将其固定到所有四个边缘:

Pin to the edge options

The whole configuration is as below:

整个配置如下:

All settings of the component

Then you can use the symbol in the page design, hide the elements when you want to, or resize it to make a multiple-line dialog:

然后,您可以在页面设计中使用符号,在需要时隐藏元素,或调整其大小以形成多行对话框:

The final effect of the component
Image for post
UX Para Minas Pretas (UX For Black Women), a Brazilian organization focused on promoting equity of Black women in the tech industry through initiatives of action, empowerment, and knowledge sharing. Silence against systemic racism is not an option. Build the design community you believe in.UX Para Minas Pretas (UX For Black Women),这是一个巴西组织,致力于通过采取行动,赋权和知识共享的举措来促进科技行业中的黑人女性平等。 对系统性种族主义保持沉默是不可行的。 建立您相信的设计社区。

翻译自: https://uxdesign.cc/create-better-reusable-symbols-in-sketch-using-smart-layout-and-resizing-46e6f21744eb

sketch浮动布局

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/275586.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

用Sql添加删除字段,判断字段是否存在的方法

增加字段alter table docdsp add dspcode char(200)删除字段ALTER TABLE table_NAME DROP COLUMN column_NAME修改字段类型ALTER TABLE table_name ALTER COLUMN column_name new_data_type改名sp_rename更改当前数据库中用户创建对象(如表、列或用户定义数据类型…

小姐姐笔记:我是如何学习简单源码拓展视野的

大家好,我是若川。这是我上周组织的源码共读纪年小姐姐的笔记,写得很好。所以分享给大家。欢迎加我微信 ruochuan12,进源码共读群。其他更多人的笔记可以阅读原文查看。川哥的源码解读文章:据说 99% 的人不知道 vue-devtools 还能…

php表决器代码,三人表决器:VHDL源代码

描述--三人表决器(三种不同的描述方式) vhdl-- Three-input Majority Voter-- The entity declaration is followed by three alternative architectures which achieve the same functionality in different ways.ENTITY maj ISPORT(a,b,c : IN BIT; m : OUT BIT);END maj;--D…

保持危机感和紧迫感_什么是紧迫的:您需要知道的一切

保持危机感和紧迫感Putting the finishing touches on a graphic design project calls for a keen eye. But you already know this, because perfectionism is just a part of the job! You look at every nook and cranny of a project before you can consider it complete…

剑指offer java版(一)

二维数组中的查找 问题描述 在一个二维数组中(每个一维数组的长度相同),每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断…

如何系统搭建现代 Web CI/CD

大家好,我是若川。今天分享一篇00后写的CI/CD直播文字稿。之前发过他的故事:一位00后前端2年经验的成长历程。我最近组织了源码共读活动,感兴趣的加我微信 ruochuan12。本次直播录播链接:https://live.juejin.cn/4354/595741[1]开…

sqlserver oracle 数据类型对应关系,SQLSERVER和ORACLE数据类型对应关系详解和对应表格整理...

Oracle SQLServer 比较 SQLServer 常见的 数据 库 类型 字符 数据 类型 CHAR CHAR :都是固定长度字符资料但oracle里面最大度为2kb,SQLServer里面最大长度为8kb 变长字符 数据 类型 VARCHAR2 VARCHAR :racle里面最大长度为4kb,SQLServer里面最大长度为8k…

优化算法汇总

interior point block coordinate relaxation Boltzmann machine 求解L1范数最小化 E. Candes, M. B. Wakin, and S. P. Boyd, “Enhancing sparsity by reweighted l1 minimization,” Journalof Fourier Analysis and Applications, vol. 14, pp. 877-905, Dec. 2008.I. Daub…

对接百度地图API

一、准备工作 百度地图开发文档 注册百度账号&#xff0c;成为开发人员&#xff0c;同时获取AK实例代码&#xff1a;<!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8"><meta name"viewport" content&quo…

ui边框设计图_UI设计形状和对象基础知识:填充和边框

ui边框设计图第2部分 (Part 2) Welcome to the second part of the UI Design shapes basics. This time we’ll cover two of the most essential properties of a shape — fills and borders. This is also a part of the free chapters from Designing User Interfaces.欢迎…

如何移除项目中无用的 console.log 代码

大家好&#xff0c;我是若川。早些天时&#xff0c;我看到一个后端公众号发《辞退了一个前端》&#xff0c;当时还想着现在后端公众号都开始吊打前端了嘛。其中有个理由就是线上还一堆console.log...我猜很多人都会移除项目中无用的console.log。可以复习一下。前言说起console…

WCF - 服务实例管理模式

WCF 提供了三种实例上下文模式&#xff1a;PreCall、PreSession 以及 Single。开发人员通过 ServiceBehavior.InstanceContextMode 就可以很容易地控制服务对象的实例管理模式。而当 WCF 释放服务对象时&#xff0c;会检查该对象是否实现了 IDisposable 接口&#xff0c;并调用…

oracle io lost,磁盘IO故障

测试工作正在如火如荼的进行&#xff0c;突然数据库就连接不上了。我连接上主机发现数据库alert_sid日志中有如下信息&#xff1a;KCF: write/open error block0x9a6 online1file2 /oracle_data1/UNDOTBS3.dbferror27072 txt: Linux Error: 5: Input/output errorAdditional in…

易思汇完成近亿元B轮融资,信中利投资

3月19日消息&#xff0c;近日&#xff0c;留学生在线付费平台易思汇宣布已在3月份完成由信中利投资的近亿元B轮融资。 易思汇联合创始人高宇同表示&#xff0c;本轮融资将主要用于留学生信用卡、留学家庭金融商城等新产品布局&#xff0c;以及扩大团队和市场投入。 易思汇成立…

远程连接 错误 内部错误_关于错误的性质和原因。 了解错误因素

远程连接 错误 内部错误Back in 2012, I was a young[er] product designer working in a small tech agency in Valencia, Spain. In parallel, I worked as a freelancer on several side projects for different clients. One day I was contacted by a new health services…

得到鹅厂最新前端开发手册一份

又逢金九银十&#xff0c;拿到大厂offer一直是程序员朋友的目标&#xff0c;但是去大厂就得拿出实力来。除了需要积累技术&#xff0c;了解并掌握面试的技巧&#xff0c;熟悉大厂面试流程&#xff0c;也必不可少。这里分享一份最新入职腾讯的前端社招面经&#xff0c;来看看鹅厂…

性能测试分析之带宽瓶颈的疑惑

第一部分&#xff0c; 测试执行 先看一图&#xff0c;再看下文 这个当然就是压力过程中带宽的使用率了&#xff0c;我们的带宽是1Gbps的&#xff0c;合计传输速率为128MB/s&#xff0c;也正因为这个就让我越来越疑惑了&#xff0c;不过通过压力过程中的各项数据我又不得不相信。…

Android 中的LayoutInflater的理解

LayoutInflater与findViewById的区别&#xff1f; 对于一个已经载入的界面&#xff0c;就可以使用findViewById()方法来获得其中的界面元素。对于一个没有被载入或者想要动态载入的界面&#xff0c;就需要使用LayoutInflater对象的inflate()方法来载入。findViewById()是查找已…

linux rootfs编译进内核,九鼎x6818开发板笔记:uboot、kernel、rootfs编译和烧写

下面记录了如何搭建嵌入开发环境&#xff0c;如何编译uboot、kernel、和文件系统&#xff0c;如何烧写镜像以及如何配置uboot环境变量。阅读注意&#xff1a;记录中(Base框中的内容)一些操作故意被添加&#xff0c;为了展示文件内容&#xff0c;故意调用cat(Ubuntu)或者type(wi…

figma下载_素描vs Figma困境

figma下载I distinctly remember how much hatred I had in my heart when I lived through my first UI update. The year was 2009; I had just gotten my braces off and I was ready to smash that ‘Like’ button on my high school crush’s status when I logged into …