WRCellView
自定義View,類似tableView的系統(tǒng)cell,使用方便
0??. Demo

微信個人信息

高德地圖我的

NBA更多

添加自定義view
1??. Installation 安裝
手動拖入
將 WRCellView 文件夾拽入項目中,導入頭文件:#import "WRCellView.h"
2??. 不同風格
/**
左側 icon label 右側 icon label indicator
0x 1 1 1 1 1
按位與運算 按位與運算符"&"是雙目運算符。其功能是參與運算的兩數(shù)各對應的二進位相與。只有對應的兩個二進位均為1時,結果位才為1 ,否則為0。參與運算的數(shù)以補碼方式出現(xiàn)。
例如:9 & 5 可寫算式如下: 00001001 & 00000101 = 00000001; 可見 9 & 5 = 1。
*/
typedef NS_ENUM(NSInteger, WRCellStyle)
{ // 以下列舉的都是常用的
WRCellStyle_Label = 0x10,
WRCellStyleLabel_ = 0x1000,
WRCellStyleLabel_Indicator = 0x1001,
WRCellStyleLabel_IconLabelIndicator = 0x1111,
WRCellStyleLabel_LabelIndicator = 0x1011,
WRCellStyleLabel_Label = 0x1010,
WRCellStyleLabel_Icon = 0x1100,
WRCellStyleLabel_IconIndicator = 0x1101,
WRCellStyleIcon_Indicator = 0x10001,
WRCellStyleIconLabel_Indicator = 0x11001,
WRCellStyleIconLabel_Icon = 0x11100,
WRCellStyleIconLabel_LabelIndicator = 0x11011,
};
3??. 接口
- (instancetype)initWithFrame:(CGRect)frame lineStyle:(WRCellStyle)style;
- (instancetype)initWithLineStyle:(WRCellStyle)style;
/** 設置底部的那條線距左邊為0 */
- (void)setLineStyleWithLeftZero;
/** 設置底部的那條線與label的左側對齊 */
- (void)setLineStyleWithLeftEqualLabelLeft;
/** 設置隱藏底部的那條線 */
- (void)setHideBottomLine:(BOOL)hideBottomLine;
/** 顯示上面的橫線,默認不顯示 */
- (void)setShowTopLine:(BOOL)showTopLine;
/** 設置自己不可以點擊 */
- (void)setCanNotSelected;
4??. 如何使用
- (WRCellView *)signView {
if (_signView == nil) {
_signView = [[WRCellView alloc] initWithLineStyle:WRCellStyleLabel_LabelIndicator];
_signView.leftLabel.text = @"個性簽名";
_signView.rightLabel.text = @"愛別人的同事也是愛自己";
[_signView setLineStyleWithLeftZero];
}
return _signView;
}
更多信息詳見代碼,也可查看Demo:
https://github.com/wangrui460/WRCellView
最近更新:
2017.05.04 16:18
- 添加自定義view Demo 2. 設置不可點擊接口
強烈推薦:超簡單!??! iOS設置狀態(tài)欄、導航欄按鈕、標題、顏色、透明度,偏移等
https://github.com/wangrui460/WRNavigationBar
https://github.com/wangrui460/WRNavigationBar_swift
歡迎關注我的微博:wangrui460