Skip to main content
Solved

0px layers now take up 1px space with Auto Layout


Show first post
This topic has been closed for comments

35 replies

SachInteractz

Hello All,
I am also experiencing the same problem with Figma’s latest desktop application. Autolayout recognizes zero frames. My goal is to create a strikethrough text effect using the zero-height/frame hack.

Here is what’s happening

Any help would be greatly appreciated

Thanks,
Sachin


tank666
  • 4863 replies
  • June 13, 2022

@SachInteractz, you are using zero-frame incorrectly. And in general, it is no longer necessary to use it in your case. Just select the line and set its absolute position.


Bruno_Garcia1

Hi @SachInteractz,

Like @tank666 said, I think you’re using them wrong:

  • Using a 0 frame in Height on a Horizontal auto-layout… In this case, you would actually need/want to use a 0 width frame. But like @tank666 said, you don’t need to use this technique anymore, you can just use absolute positioning 🙂

SachInteractz

Thank you @tank666 and @Bruno_Garcia1 absolute positioning is the best approach here.


SachInteractz

Hey, I was just digging throughAuto Layout Tips & Hacks by @Gleb and found that in his strikethrough example he is also using a zero-height hack. When I copied the same frame and pasted it to my file the auto layout broke as it recognized zero-frame.

Here is what’s happening

Could anyone explain this to me?

Thanks,
Sachin


SachInteractz

One can use zero-height in a but the direction has to be vertical.


tank666
  • 4863 replies
  • June 14, 2022

Your problem is that you are using Auto Layout’s horizontal direction instead of vertical.


Gleb
  • Power Member
  • 4706 replies
  • June 14, 2022

You need to set Auto Layout direction to Vertical. To understand the zero-height frames better watch my Config talk:

But you don’t need to use zero-frames anymore since auto layout now supports absolute position.


SachInteractz

Yeah Thanks, @Gleb, and @tank666 you guys are awesome


  • 0 replies
  • July 14, 2022

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings