Code Monkey home page Code Monkey logo

bmline's Introduction

BMLine!

方便的为你的View增加线条吧!

加入你的工程?

只需将BMLine文件夹及里面相应的文件拷入你的项目,需要使用的地方引入UIView+BMLine.h即可!

或者?

用CocoaPods!

你懂的~

pod 'BMLine', '~> 1.0'

如何使用?

最简单的,在View的上方增加一条直线:

[_View addLineWithType:BMLineTypeCustomDefault color:nil position:BMLinePostionCustomTop];

在一个View四周加上线条:

[_VIew addLineWithType:BMLineTypeCustomDefault color:[UIColor blueColor] position:BMLinePostionCustomAll];

删除这个View上某个位置的一条线:

[_VIew removeLineWithPosition:BMLinePostionCustomCenterY];

删除这个View上所有的BMLine:

[_mid2VIew removeAllLines];

一些参数说明:

BMLineTypeCustomDefault ======直线

BMLineTypeCustomDash ======虚线

BMLineTypeCustomDot ======小圆点

BMLineTypeCustomTriangle ======小三角

BMLinePostionCustomTop ======View上方

BMLinePostionCustomCenterX ======View水平中间

BMLinePostionCustomBottom ======View下方

BMLinePostionCustomRight ======View右方

BMLinePostionCustomCenterY ======View垂直中间

BMLinePostionCustomLeft ======View左方

BMLinePostionCustomAll ======View四周

关于线条的大小?

可以在defines.h的相应区域内找到一些可定制的参数

注意事项?

如果你使用自动布局,请不要在viewDidLoad和viewWillAppear中一上来就使用噢,那会View的frame其实还没计算好,很容易出现大小不对的问题~建议在viewDidAppear中使用

另外还做了一些防Crash的处理,有问题和好的建议可以和我联系:QQ 188561521

bmline's People

Contributors

airsars avatar

Watchers

 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.