Giter VIP home page Giter VIP logo

llbootstrapbutton's Introduction

LLBootstrapButton

Bootstrap 3.0扁平化风格按钮,一句代码调用
  以前开发过web端的同学可能用过Twitter公司出的一个前端框架Bootstrap,当时刚接触的时候是2.0的版本,后来是3.0,从立体化的风格到现在扁平化的风格,一直以一种简约大方的设计风格体现,深受开发者的喜爱

  对于我们这种没有美工妹纸当女票的人来说移动开发就是悲剧,所以后来发现Android开发中也有Bootstrap和BootstrapButton两个框架,显示风格和网页扁平简约的风格一样。于是最近将BootstrapButton部分移植了一个OC版本,以便喜欢这种风格的同学方便使用,维持了原本web端自带的图标字体(fontawesome),可一键调用!!!

  先上效果图,共6种风格,每种分正常,高亮,也可添加图标

image

使用方法

  • CocoaPods(若未获取成功需重新 pod setup )
pod "LLBootstrapButton"

  CocoaPods导入后则无需手动导入Bundle,可直接使用

  • 导入
#import "LLBootstrap.h"

添加背景效果

[button bs_configureAsDefaultStyle]

  分为6中风格,默认是可点击

[button bs_configureAsDefaultStyle]              // 默认
[button bs_configureAsPrimaryStyle]              // 原色
[button bs_configureAsSuccessStyle]              // 成功
[button bs_configureAsInfoStyle]                 // 消息
[button bs_configureAsWarningStyle]              // 警告
[button bs_configureAsDangerStyle]               // 危险



添加图标

  • 导入Bundle到项目中(若使用CocoaPods集成则无需此操作)
    image
  • 调用方法(根据图标代码选择图标)
// 使用图标签需要先设置字体
UIFont *font = [UIFont bs_awesomeFontOfSize:16.f];

``` [button.titleLabel setFont:[UIFont bs_awesomeFontOfSize:16.f]]; // 选择苹果图标,置前 [button setTitle:[NSString stringWithFormat:@"%@ Primary", @"fa-apple".bs_awesomeIconRepresentation] forState:UIControlStateNormal]; ```
``` // UITextView直接显示图标 [textview setText:[NSString stringWithFormat:@"这是一个%@图标",@"fa-github-alt".bs_awesomeIconRepresentation]]; ``` * 支持图标可达300多种,符合大部分需求
![image](https://github.com/lilei644/LLBootstrapButton/blob/master/Img/fontIcon.png)   图标代码打开资源文件中的htm文件即可显示所有图标
`使用注意:由于图标为文字生成,所以必须设置字体`

致谢

llbootstrapbutton's People

Contributors

lilei644 avatar

Stargazers

Vincent  avatar

Watchers

James Cloos avatar Vincent  avatar

Forkers

chinagood

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.