Code Monkey home page Code Monkey logo

chained's Introduction

iOS 链式编程

先试一个用链式创建一个label


CGRect frame = CGRectMake(100, 100, 100, 100);
SLObjc *lab = [SLObjc it];
lab.fra(frame).bc(kCol.red).txt(@"测试").tc(kCol.yel).tf(14).ali_l.show(self.view).hid(@1).numL(0);
lab.fra(frame).bc(kCol.red);

先试一个用链式创建一个Button


CGRect bf = CGRectMake(100, 220, 100, 100);
SLBtn *btn = [SLBtn it];
btn.frame = bf;
[btn setTitle:@"1321" forState:(UIControlStateNormal)];
[self.view addSubview:btn];
btn.fra(bf).txtN(@"按钮").tf(38).ali(2).show(self.view);

链式编程自定义控件日后会越来越多的。

在整个项目中都使用链式写控件话会少写很多重复的代码。

请大家多多指教!

谢谢 大家的参考~

chained's People

Contributors

victory886 avatar

Watchers

James Cloos avatar  avatar

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.