Code Monkey home page Code Monkey logo

Comments (9)

tospery avatar tospery commented on June 3, 2024 1

[ThemeManager colorFor:@"primaryColor"];可以满足我的需要,谢谢。

from swifttheme.

wxxsw avatar wxxsw commented on June 3, 2024

当前主题索引是 0 或者 1 吗?

from swifttheme.

tospery avatar tospery commented on June 3, 2024

image
image

from swifttheme.

tospery avatar tospery commented on June 3, 2024

当前主题索引是 0 或者 1 吗?

只有一个主题,索引为0

from swifttheme.

tospery avatar tospery commented on June 3, 2024

我的需求是,获取主题的具体颜色,用在富文本中。但我发现只能拿picker,拿不到color。不知道是不是OC的原因

from swifttheme.

wxxsw avatar wxxsw commented on June 3, 2024

哦是的,OC 目前不支持获取 value

可以考虑使用 label.theme_attributedText

from swifttheme.

wxxsw avatar wxxsw commented on June 3, 2024

实例:

label.theme_attributedText = [ThemeAttributedStringPicker pickerWithKeyPath:@"backgroundColor" map:^NSAttributedString * _Nullable(id _Nullable value) {
    NSString *hex = (NSString *)value;
    UIColor *color = [[UIColor alloc] initWithRgba:hexString defaultColor:[UIColor clearColor]];
    return value;
}];

from swifttheme.

tospery avatar tospery commented on June 3, 2024

嗯嗯,明白你的意思。我有用一个三方库DZNEmptyDataSet,它通过代理方法返回NSAttributedString来展示空页面的文案。
image
如果可以的话,希望能把value暴露给OC一下呢

from swifttheme.

wxxsw avatar wxxsw commented on June 3, 2024

因为 value 是在基类里面的,所以实际上即便暴露了,也无法返回 UIColor 类型,只能返回 id 类型。

如果 id 类型可以接受的话,可以使用 [ThemeManager valueFor:@"keyPath"];

from swifttheme.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.