ayvibrantbutton

<a href="https://github.com/a1anyip/ayvibrantbutton" target="_blank">https://github.com/a1anyip/ayvibrantbutton</a>
ayvibrantbutton is a stylish button with ios 8 vibrancy effect. it is a subclass of <code>uibutton</code> that has a simple yet elegant appearance and built-in support for <code>uivisualeffectview</code> and <code>uivibrancyeffect </code>classes introduced in ios 8. yet, it can be used on ios 7 without the vibrancy effect.
ayvibrantbutton是一個具有 ios 8 模糊背景效果的按鈕.他繼承自 uibutton, 有一個很漂亮的樣式, 内置了 ios8 中新出的 uivisualeffectview 與 uivibrancyeffect .當然, 你也可以用在 ios7 上, 隻是沒有模糊背景效果而已.
configurations
vibrant buttons can be configured with one of the three supported button styles, invert, translucentand fill (see examples below).
該按鈕可以配置3種樣式.
some basic properties like icon, text, font, alpha, corner radius, border width and background color (for no vibrancy effect) can all be changed easily.
所有的基本屬性,如圖檔, 文本, 字型, 透明度, 圓角, 以及邊緣線條寬度以及背景色等等屬性, 都可以進行修改.
the default vibrancy effect is for blur effect <code>uiblureffectstylelight</code>. it could be set to any<code>uivibrancyeffect</code> instance. for today extensions, it should be set to <code>[uivibrancyeffect notificationcentervibrancyeffect]</code>.
預設的模糊效果是 uiblureffectstylelight , 他可以用來設定任何的 any<code>uivibrancyeffect 對象. 現在已經對其進行了很多擴充, 支援 [uivibrancyeffect notificationcentervibrancyeffect] .</code>
note
though vibrant buttons can be placed anywhere, it is recommended that vibrant buttons with vibrancy effects should be placed in the <code>contentview</code> of <code>uivisualeffectview</code> (except in today view).
<code>uivisualeffectview</code> can be created as follows.
雖然這個按鈕可以放置在任何地方, 但是呢, 我還是推薦将其放置在 uivisualeffectview 的 contentview 裡面.
installation
cocoapods
add the following line to the <code>podfile</code>.
你可以用 pod "ayvibrantbutton" 來進行安裝.
manual installation
simply add <code>ayvibrantbutton.h</code> and <code>ayvibrantbutton.m</code> to your project.
直接将 <code>ayvibrantbutton.h</code> 與 <code>ayvibrantbutton.m 拖到你的項目中去即可.</code>
examples
the following images show the normal and highlighted (being pressed) button appearances.
以下例子示範了正常狀态與高亮狀态中的按鈕的樣式.
invert style with vibrancy effect
translucent style with vibrancy effect
translucent style without vibrancy effect
changelog
added a new button style <code>ayvibrantbuttonstylefill</code>
fixed an issue that setting button alpha removes the vibrancy effect
support setting icon image
creator
alan yip
<a href="http://alanyip.me/">http://alanyip.me</a>
<a href="https://twitter.com/tweakcc">@tweakcc</a>
license