简体   繁体   English

在 SwiftUI 中,当操作表出现时会发生什么?

[英]In SwiftUI, what happens when an actionsheet shows up?

The default accent color of the button, will automatically change to gray(disabled or un-touchable) when an actionsheet shows up.当操作表出现时,按钮的默认强调色将自动更改为灰色(禁用或不可触摸)。 But with custom accent color, this will not happen.但是使用自定义强调色,这不会发生。

So what caused this behaviour of the button with default accent color?那么是什么导致了带有默认强调色的按钮的这种行为呢?

前 后

I reckon (as I couldn't find one) there's no documentation for it.我认为(因为我找不到)没有相关文档。

But as we can all observe, I believe if you use Color.accentColor in any views, and when an ActionSheet comes up, all views will be enumerated and if such view has Color.accentColor for its any color-able property, that property will be toggled (changed to gray and back to accentColor).但正如我们所观察到的,我相信如果您在任何视图中使用Color.accentColor ,并且当ActionSheet出现时,所有视图都将被枚举,如果此类视图具有Color.accentColor作为其任何可着色属性,则该属性将被切换(更改为灰色并返回到重音颜色)。

For instance, a ZStack with Color.accentColor .例如,带有Color.accentColor的 ZStack。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM