Code Monkey home page Code Monkey logo

Comments (1)

hon-key avatar hon-key commented on May 29, 2024

事实上,确实是缺少一种通用的入口去设置这种文字序号,不过单独为这种序号添加功能却有点不太通用,即使实现了这种入口,实际上想要自定义风格的话成本还是挺大的。
实际上,通过现有的接口,想要写出这样的效果其实并不复杂。
假设有这样一种需求:
我们需要从后台拉取一个数组的字符串,并以列表的方式显示,显示效果类似:

  1. 第一条
  2. 第二条
  3. 第三条

写法如下:

NudeIn *numberList = [NudeIn make:^(NUDTextMaker *make) {
    make.textTemplate(@"number prefix").···.attach();
    for (int i = 0; i < textArray.count; i++) {
        make.text([NSString stringWithFormat:@"%d. ",i]).attachWith(@"number prefix",nil);
        make.text(string).···.ln(1).attach();
    }
}];

from nudein.

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.