Material: Switch Too narrow;

Created on 23 Aug 2017  ·  12Comments  ·  Source: CosmicMind/Material

help wanted high priority investigate material

Most helpful comment

As a workaround you can subclass it and return custom intrinsicContentSize.

All 12 comments

You will need to describe more than this please.

Set the size to medium or large,width too narrow;
image

hmmm... okay, I will take a look. Thanks.

The width for .small is also smaller than intended

This is my Switch:

theSwitch = Switch(state: .off, style: .light, size: .small)
theCell.layout(theSwitch).right(16).top(16).bottom(16)

which leads to
screen shot 2017-08-25 at 08 53 22
This is the Switch from https://github.com/CosmicMind/Material#switch
screen shot 2017-08-25 at 08 53 06

As a workaround you can subclass it and return custom intrinsicContentSize.

I am not sure if this is an issue or just an incorrect use of the Switch control. If there is an issue here to solve, please reopen this. Thank you!

I can confirm that this is an issue. As you can see @theolof comment.
I face the same problem that the switch is too short for all swith size.

I see, okay I have reopened the issue and will run the sample project and see what's up. Thanks for the feedback :)

Has this already fixed?

Can someone test this commit, who has been facing this issue: 4433996f6f89bce19b11f917182d89f4877b5077, thank you!

It's better now.
screen shot 2018-02-08 at 08 15 49

Cool, so unless there is further need to adjust the sizing, I am going to close this issue and the next release will include this fix. Thank you!

Was this page helpful?
0 / 5 - 0 ratings