iOS BButton使用小結(jié)

BButton按鈕樣式分為2.0版本和3.0版本

  • 如下圖所示
BButton樣式2.0版本.png

BButton樣式3.0版本.png
  • 使用步驟
  • 為支持FontAwesome這個(gè)巨牛逼的文字庫(kù),需要在Info.plist里面添加該項(xiàng)目(重點(diǎn)!!!)
info.plist.png
  • 簡(jiǎn)單示例代碼
//按鈕尺寸
CGRect frame = CGRectMake(100, 200, 100, 30);
//按鈕背景色格式
BButtonType type = BButtonTypePrimary;
//按鈕3.0版本
BButtonStyle style = BButtonStyleBootstrapV3;
self.testBtn = [[BButton alloc]initWithFrame:frame type:type style:style icon:FAThumbsOUp fontSize:15];
[self.testBtn setTitle:@"登錄" forState:UIControlStateNormal];
//NO:文字在前,圖片在后   YES:圖片在前,文字在后 
[self.testBtn addAwesomeIcon:FAThumbsOUp beforeTitle:NO];
[self.view addSubview:self.testBtn];
登錄.png
  • 按鈕圓角處理示例代碼
[[BButton appearance] setButtonCornerRadius:[NSNumber numberWithFloat:50.0f]];
圓角效果圖片.png

勤學(xué)如早春之苗,不見(jiàn)其增,日有所漲。
輟學(xué)如磨刀之石,不見(jiàn)其減,日有所損。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

推薦閱讀更多精彩內(nèi)容