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.pswp.cn/news/275586.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/275586.shtml
英文地址,請注明出處:http://en.pswp.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 …