• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Yu-w/WYMaterialButton: Interactive and fully animated Material Design button for ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

Yu-w/WYMaterialButton

开源软件地址(OpenSource Url):

https://github.com/Yu-w/WYMaterialButton

开源编程语言(OpenSource Language):

Objective-C++ 36.8%

开源软件介绍(OpenSource Introduction):

WYMaterialButton

Version License Platform

Inspired by Google Material Design, written purely in Swift 3.

WYMaterialButton implemented Material Design on iOS and add more dynamic motions, allowing iOS buttons to be more responsive and interactive.

Integrated with Spring animations and enhanced by Facebook's POP, WYMaterialButton is super animated and programmer-friendly. All settings can be customized in storyboard inspector.

Installation

WYMaterialButton is available through CocoaPods.

To install via CocoaPods add this lines to your Podfile

use_frameworks!
pod "WYMaterialButton"

Note: Due to CocoaPods/CocoaPods#4420 issue there is problem with compiling project with Xcode 7.1 and CocoaPods v0.39.0. However there is a temporary workaround for this: Add next lines to the end of your Podfile

post_install do |installer|
    `find Pods -regex 'Pods/pop.*\\.h' -print0 | xargs -0 sed -i '' 's/\\(<\\)pop\\/\\(.*\\)\\(>\\)/\\"\\2\\"/'`
end

Or download the git repository

git clone https://github.com/yuwang17/WYMaterialButton.git

Drag WYMaterialButton related files into your own project, and install facebook's POP via cocoapods

Then import the module in your file

import WYMaterialButton

If you're Objective-C user, please include the header file

#import "WYMaterialButton-Swift.h"

Usage

  1. Add a UIButton in the Storyboard of your project.

  2. Subclass the UIbutton as WYMaterialButton in identity inspector.

  3. Select a color as Material Color, the first row in attribute inspector, and let WYMaterialButton do everything else for you. You can also do other setting as well for further customizations.

c

Specification

  • For most cases, Material Color is the only property you need to set. Leave others as default.

  • Pulse Enable enable defautly, which control the bounce effect.

  • With Touch Location Enable enabled defautly, WYMaterialButton tracks your touch location and generate a ripple animation upon that. You can disable to always center the ripple effect on the button.

  • Material Effect Percent speicifies the percentage of area of the button will have material effect when being pressed. Default to 0.8.

  • You can of course access all these properties and more by using codes. For example:

    myButton.materialColor = .blue

Demo

  1. Download the repository
git clone https://github.com/yuwang17/WYMaterialButton.git
cd WYMaterialButton/Example
  1. Open the workspace
open WYMaterialButton.xcworkspace
  1. Compile and run the app in simulator
  • Under Xcode, press Ctrl + R

Supported OS & SDK Versions

  • Xcode 7
  • iOS 7

Credits

Spring: subclass @Mengto's Spring framework for supporting additional animations and quick settings in the button.

POP: Facebook's animation framework for simulating the bounce effect.

Material Design: animation idea and effects come from Google's material design concept.

License

WYMaterialButton is available under the MIT License, see LICENSE for more infomation.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap