figma下載_在Figma中將約束與布局網格一起使用

figma下載

While doing research for the book “Designing in Figma”, I discovered a powerful way to lay out objects using a combination of Layout Grid and Constraints. The interface of Figma does not indicate a connection between the two, so it can be discovered either by a happy accident or from reading a help article. Luckily, the latter is my kind of fun pastime.

在為《 Figma中的設計 》一書進行研究時,我發現了一種結合使用布局網格和約束來布置對象的有效方法。 Figma的界面并不表示兩者之間的聯系,因此可以通過意外事故或閱讀幫助文章來發現它。 幸運的是,后者是我的一種消遣方式。

Let’s start with a quick overview of how Constraints and Layout Grids work on their own, and then see how they can be used together.

讓我們首先快速了解一下約束和布局網格如何獨立工作,然后了解如何將它們一起使用。

約束條件 (Constraints)

Constraints define how objects respond when their parent frame is resized. This is useful when the same frame or component is being used in multiple sizes. Constraints can be set separately along both the horizontal and vertical axis. The object can scale with the frame, or stick to its center, one side, or both sides.

約束定義對象在調整其父框架的大小時的響應方式。 當同一框架或組件以多種尺寸使用時,這很有用。 可以沿水平和垂直軸分別設置約束。 對象可以隨框架縮放,也可以固定在其中心,一側或兩側。

布局網格 (Layout Grids)

Figma has three tools for creating Layout Grids — Grid, Columns, and Rows. They can be combined in any way, even with multiple grids of the same type overlaying one another. For our use case, we’re interested only in Columns and Rows. They can be created either fixed or stretchy.

Figma具有用于創建布局網格的三個工具-網格,列和行。 它們可以以任何方式組合,即使同一類型的多個網格相互重疊也是如此。 對于我們的用例,我們僅對ColumnsRows感興趣。 可以將其創建為固定的或拉伸的。

Fixed columns and rows have fixed width or height and can be aligned to either side or center of the frame. Fixed columns are useful if your mockup has a fixed width or you design for a single screen size, which is quite rare nowadays. Fixed rows are great for creating baseline grids and aligning text to them.

固定的列和行具有固定的寬度或高度,并且可以與框架的一側或中央對齊。 如果您的模型具有固定的寬度或設計為單個屏幕大小,則固定列很有用,這在當今非常罕見。 固定行非常適合創建基線網格并將文本對齊它們。

Image for post
Fixed columns
固定柱

Stretchy layout grids have almost the same properties as fixed, but their width or height is automatically calculated based on dimensions of the frame, number of columns or rows, gutter, and margin. Stretchy columns and rows provide a great foundation for responsive design on the web and adaptive layouts in the apps.

可拉伸的布局網格具有與固定的幾乎相同的屬性,但是它們的寬度或高度是根據框架的尺寸,列數或行數,裝訂線和邊距自動計算的。 可伸縮的列和行為Web上的自適應設計和應用程序中的自適應布局奠定了良好的基礎。

Image for post
Stretchy columns
彈力柱

約束+布局網格=?? (Constraints + Layout Grids = ??)

Layout Grid is not just a visual aid. When applied to the frame, it helps Figma align nested objects when the frame is being resized. If you use stretchy grids, a child’s Constraints will be based on the nearest column or row of the grid instead of the frame. This helps maintain fixed gutters and results in more realistic scaling behavior.

布局網格不僅是視覺上的幫助。 應用于框架時,它可以在調整框架大小時幫助Figma對齊嵌套對象。 如果使用拉伸網格,則孩子的約束將基于網格的最近列或行而不是框架。 這有助于保持固定的裝訂線并導致更實際的縮放行為。

分配對象 (Distribute Objects)

To experiment with this behavior, let’s prototype a toolbar of the mobile app and set Constraints of the icons to Center and Center. It works fine when we change the orientation, but there is definitely room for improvement:

為了試驗這種行為,讓我們為移動應用程序的工具欄設計原型,并將圖標的約束設置為Center和Center。 當我們更改方向時,它可以很好地工作,但是肯定還有改進的空間:

Image for post
Icons constrained to the center of the frame
圖標限制在框架中心

Now, let’s apply Layout Grid with three stretchy columns to the toolbar:

現在,將帶有三個可伸縮列的布局網格應用于工具欄:

Image for post
Icons aligned to the grid
圖標對齊網格

Icons are aligned to the columns, and their Constraints are set to Center and Center. When we change frame’s orientation to the landscape now, they’re properly distributed in the toolbar.

圖標與列對齊,并且其約束設置為居中和居中。 現在,當我們將框架的方向更改為橫向時,它們已正確分布在工具欄中。

固定間距 (Fixed Spacing)

The same technique can be used for maintaining fixed gutters and margins when resizing the frame. In the next example, Layout Grid wasn’t used, and both horizontal and vertical Constraints on the blocks were set to Scale. When the parent frame is resized, both gutters and margins are scaled proportionally.

調整框架大小時,可以使用相同的技術來保持固定的裝訂線和邊距。 在下一個示例中,未使用“布局網格”,并且塊上的水平和垂直約束都設置為“縮放”。 調整父幀的大小時,裝訂線和邊距均按比例縮放。

Image for post

On a fixed example, the Layout Grid was defined with stretchy columns and grids, and Constraints of the blocks were set to Left-Right and Top-Bottom. When resized, all objects stick to the grid and spacing around them is unchanged.

在固定示例中,使用可伸縮的列和網格定義“布局網格”,并將“塊”的“約束”設置為“左-右”和“上下”。 調整大小后,所有對象都將粘在網格上,并且周圍的間距不變。

Image for post
Just one row might have been enough in this case
在這種情況下,僅一行就足夠了

結論 (Conclusion)

After learning about a powerful combination of Constraints and Layout Grids, I couldn’t stop thinking about why it has no presence in the interface. Maybe it’s a simple oversight, or perhaps the team at Figma plans to evolve Auto Layout to make this combination obsolete. In any case, right now there is no better way to distribute objects and create consistent spacing than with Constraints and Layout Grids. By adding this tool to our toolbox, we can remove another barrier to creating flexible layouts and truly reusable components when designing in Figma.

在了解了約束和布局網格的強大組合之后,我就停止思考為什么它在界面中不存在。 也許這只是一個簡單的疏忽,或者Figma的團隊計劃開發Auto Layout來使這種組合過時。 無論如何,目前沒有比約束和布局網格更好的方法來分配對象和創建一致的間距。 通過將此工具添加到我們的工具箱中,我們可以消除在Figma中進行設計時創建靈活布局和真正可重用組件的另一障礙。

You can play and experiment with all the examples from this article by duplicating a Figma Community file.

您可以通過復制Figma社區文件來播放和嘗試本文中的所有示例。

翻譯自: https://blog.prototypr.io/using-constraints-with-layout-grids-in-figma-609ad3d9ef69

figma下載

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/274951.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/274951.shtml
英文地址,請注明出處:http://en.pswp.cn/news/274951.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

換一種方式表達

http://player.youku.com/player.php/sid/XMjY2MTE5NDU2/v.swf 轉載于:https://www.cnblogs.com/JCSU/archive/2012/03/17/2403324.html

新的一年,碎片化學習前端,我推薦這幾個公眾號~

大家好,我是若川。假期余額不足,無法充值。快樂的時光總是短暫的。馬上又開始一年的學習和“奮斗”。前端技術日新月異,發展迅速,作為一個與時俱進的前端工程師,需要不斷的學習。這里強烈推薦幾個前端開發工程師必備的…

Java單元測試之JUnit4詳解

2019獨角獸企業重金招聘Python工程師標準>>> Java單元測試之JUnit4詳解 與JUnit3不同,JUnit4通過注解的方式來識別測試方法。目前支持的主要注解有: BeforeClass 全局只會執行一次,而且是第一個運行Before 在測試方法運行之前運行…

我在黑暗中看到你眼中的月光_你好黑暗,我的老朋友

我在黑暗中看到你眼中的月光(Originally published on https://web.dev/prefers-color-scheme/.)(最初發布于https://web.dev/prefers-color-scheme/ 。) 介紹 (Introduction) 📚 I have done a lot of background research on the history and theory of dark mod…

ant 實現批量打包android應用

很多的應用中需要加上應用推廣的統計,如果一個一個的去生成不同渠道包的應用,效率低不說,還有可能不小心弄錯了分發渠道,使用ant可以批量生成應用。一、添加渠道包信息為了統計渠道信息,就不得不在程序的某個地方加入渠…

Element Plus 正式版發布啦!

大家好,我是若川。祝大家新年快樂,開工大吉。公眾號回復「紅包」可以領取源碼共讀紅包封面。持續組織了6個月源碼共讀活動,感興趣的可以點此加我微信 ruochuan12 參與,每周大家一起學習200行左右的源碼,共同進步。同時…

大型網站技術架構(一)大型網站架構演化

2019獨角獸企業重金招聘Python工程師標準>>> 看完了有一本書,就應該有所收獲,有所總結,最近把《大型網站技術架構》一書給看完了,給人的印象實在深刻,再加上之前也搞過書本上講的反向代理和負載均衡以及ses…

永不示弱_永不過時的網頁設計:今天和2000年的在線投資組合

永不示弱重點 (Top highlight)Philippe Starck, a renowned industrial designer, once said:著名的工業設計師Philippe Starck曾經說過: “A designer has a duty to create timeless design. To be timeless you have to think really far into the future, not …

如何使用 React 創建一個作品集網站

大家好,我是若川。持續組織了6個月源碼共讀活動,感興趣的可以點此加我微信 ruochuan12 參與,每周大家一起學習200行左右的源碼,共同進步。同時極力推薦訂閱我寫的《學習源碼整體架構系列》 包含20余篇源碼文章。今天,你…

博弈論入門 HDU 1850

Problem Description 一年在外 父母時刻牽掛春節回家 你能做幾天好孩子嗎寒假里嘗試做做下面的事情吧陪媽媽逛一次菜場悄悄給爸爸買個小禮物主動地 強烈地 要求洗一次碗某一天早起 給爸媽用心地做回早餐如果愿意 你還可以和爸媽說咱們玩個小游戲吧 ACM課上學的呢~下…

新的一年,如何高效學習前端前沿知識~

今天強烈推薦一些互聯網行業內優質技術公眾號,互聯網人大部分都關注了,包括目前主流的公司技術團隊號,技術社區號,個人技術號,這些號行業深耕已久,會給你帶來事半功倍的效果。公眾號那么多,文章…

RabbitMQ學習總結(7)——Spring整合RabbitMQ實例

2019獨角獸企業重金招聘Python工程師標準>>> 1.RabbitMQ簡介 RabbitMQ是流行的開源消息隊列系統,用erlang語言開發。RabbitMQ是AMQP(高級消息隊列協議)的標準實現。 官網:http://www.rabbitmq.com/ 2.Spring集成Rabbi…

UIScrollView實現不全屏分頁的小技巧

瀏覽一系列圖片時,我們會經常使用UIScrollView來進行實現,因為其自帶的pagingEnabled屬性,可以非常方便的自動支持手勢左右輕掃切換切換頁面。pagingEnabled不過最近做的一個產品,設計的效果有所不同,希望每一頁圖片的…

談談對java中分層的理解_讓我們談談網頁設計中的卡片設計

談談對java中分層的理解“I want a card”, this is the first demand point that the customer said in the last issue when talking to me about demand. There is no doubt that the card type is excellent for both PC and mobile phones. From online shopping malls to…

1-jdk的安裝與配置

1- Jvm、jdk、jre之間的關系 JVM:Java虛擬機,保證java程序跨平臺。(Java Virtual Machine)JRE: Java運行環境,包含JVM和核心類庫。如果只是想運行java程序,只要安裝JRE即可。(Java R…

來自未來,2022 年的前端人都在做什么?

大家好,我是若川。持續組織了6個月源碼共讀活動,感興趣的可以點此加我微信 ruochuan12 參與,每周大家一起學習200行左右的源碼,共同進步。同時極力推薦訂閱我寫的《學習源碼整體架構系列》 包含20余篇源碼文章。來自上帝視角的總覽…

模擬

狀態壓縮 uva 12368 - Candles 2011 - Dhaka 1 #include<stdio.h> 2 #include<string.h> 3 #include<iostream> 4 #include<string> 5 #include<algorithm> 6 #include<math.h> 7 #include<map> 8 #include<queue> 9 using…

qt ui指針和本類對象_您需要了解的有關UI設計的形狀和對象的所有信息

qt ui指針和本類對象重點 (Top highlight)第1部分 (Part 1) So you’re thinking about becoming a UX/UI designer, but are afraid to start? Don’t worry. It’s easier than you think. You only need a solid foundation and a lot of dedication. I can’t help you wi…

移動端h5頁面復制粘貼(兼容到ios9安卓4.0.0)

項目使用jquery框架純h5復制粘貼解決了iscroll4阻止所有默認事件&#xff0c;長按無法彈出復制菜單項目需要寫一個上拉加載頁面&#xff0c;頁面中的物流信息需要可復制粘貼&#xff0c;同時需要兼容到ios9和安卓4.0.0, 經過大量搜索&#xff0c;最終使用clipboard。代碼如下 &…

2021 大前端技術回顧及未來展望

大家好&#xff0c;我是若川。持續組織了6個月源碼共讀活動&#xff0c;感興趣的可以點此加我微信 ruochuan12 參與&#xff0c;每周大家一起學習200行左右的源碼&#xff0c;共同進步。同時極力推薦訂閱我寫的《學習源碼整體架構系列》 包含20余篇源碼文章。歷史面試系列2021 …