gpt4 book ai didi

ios - 如何以编程方式在 Pixate 中获取特定的 CSS 值?

转载 作者:行者123 更新时间:2023-12-01 12:49:18 24 4
gpt4 key购买 nike

有没有办法以编程方式从 Pixate 获取值?我希望能够获取特定 ID、类或元素的 CSS 值。

最佳答案

这是一个关于如何获取 View 色调颜色的示例。当然,任何属性名称都可以代替。

PXStylesheet *currentSheet = [PixateFreestyle currentApplicationStylesheet];
PXRuleSet *rules = [currentSheet ruleSetsMatchingStyleable:view][0];
PXDeclaration * decl = [rules declarationForName:@"-ios-tint-color"];
UIColor *color = decl.colorValue;

注意事项

  • 您可以拥有多个样式表。用户、 View 和应用程序。如果是这种情况,请使用 [PXRuleSet ruleSetWithMergedRuleSets:rules]

  • ruleSetsMatchingStyleable:是私有(private)电话。您需要包含 PXStylesheet-Private.h

  • 在我的示例中,我只有 1 个规则集。您可能有更多,因此您可能想要迭代 ruleSetsMatchingStyleable: 的响应。

关于ios - 如何以编程方式在 Pixate 中获取特定的 CSS 值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22520870/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com