#pragma mark AboutSomeValue
1.UITableViewCell样式
typedef NS_ENUM(NSInteger, UITableViewCellStyle) {
UITableViewCellStyleDefault,
UITableViewCellStyleValue1,
UITableViewCellStyleValue2,
UITableViewCellStyleSubtitle
};
2.分割线UITableViewCell的样式
typedef NS_ENUM(NSInteger, UITableViewCellSeparatorStyle) {
UITableViewCellSeparatorStyleNone,//无
UITableViewCellSeparatorStyleSingleLine,//细线
UITableViewCellSeparatorStyleSingleLineEtched
} __TVOS_PROHIBITED;
3.UITableViewCell选中的样式
typedef NS_ENUM(NSInteger, UITableViewCellSelectionStyle) {
UITableViewCellSelectionStyleNone,
UITableViewCellSelectionStyleBlue,
UITableViewCellSelectionStyleGray,
UITableViewCellSelectionStyleDefault NS_ENUM_AVAILABLE_IOS(7_0)
};
4.UITableViewCell聚焦样式
typedef NS_ENUM(NSInteger, UITableViewCellFocusStyle) {
UITableViewCellFocusStyleDefault,
UITableViewCellFocusStyleCustom
} NS_ENUM_AVAILABLE_IOS(9_0);
5.UITableViewCell编辑样式
typedef NS_ENUM(NSInteger, UITableViewCellEditingStyle) {
UITableViewCellEditingStyleNone,
UITableViewCellEditingStyleDelete,
UITableViewCellEditingStyleInsert
};
6.tableViewCellAccessoryType的值(eg:当跳转到下一界面时cell右侧可能显示一个箭头什么的),附加控件类型
typedef NS_ENUM(NSInteger, UITableViewCellAccessoryType) {
UITableViewCellAccessoryNone,
UITableViewCellAccessoryDisclosureIndicator,
UITableViewCellAccessoryDetailDisclosureButton,
UITableViewCellAccessoryCheckmark,
UITableViewCellAccessoryDetailButton
};
7.
typedef NS_OPTIONS(NSUInteger, UITableViewCellStateMask) {
UITableViewCellStateDefaultMask = 0,
UITableViewCellStateShowingEditControlMask = 1 << 0,
UITableViewCellStateShowingDeleteConfirmationMask = 1 << 1
};
#pramark UITableViewCelll类继承自UIView
一、创建
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(nullable NSString *)reuseIdentifier NS_AVAILABLE_IOS(3_0) NS_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder NS_DESIGNATED_INITIALIZER;
二、UITableViewCell内容
1.图片,default is nil.
@property (nonatomic, readonly, strong, nullable) UIImageView *imageView
2.标题,default is nil.
@property (nonatomic, readonly, strong, nullable) UILabel *textLabel .
3.详细标题,default is nil.
@property (nonatomic, readonly, strong, nullable) UILabel *detailTextLabel
4.当我们要自定制cell时,去要添加到内容视图contentView上
@property (nonatomic, readonly, strong) UIView *contentView;
5.背景视图
@property (nonatomic, strong, nullable) UIView *backgroundView;
6.选中时的背景视图
@property (nonatomic, strong, nullable) UIView *selectedBackgroundView;
7.多选时的背景视图
@property (nonatomic, strong, nullable) UIView *multipleSelectionBackgroundView;
8.cell复用时的标记
@property (nonatomic, readonly, copy, nullable) NSString *reuseIdentifier;
9.在tableView调用dequeueReusableCellWithIdentifier:之前调用,如果要重载则必须调用[super prepareForReuse];
- (void)prepareForReuse;
10.cell选中时的样式,默认是UITableViewCellSelectionStyleBlue.
@property (nonatomic) UITableViewCellSelectionStyle selectionStyle;
11.是否选中,是否高亮
@property (nonatomic, getter=isSelected) BOOL selected;
@property (nonatomic, getter=isHighlighted) BOOL highlighted;
- (void)setSelected:(BOOL)selected animated:(BOOL)animated;
- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated;
12.cell的编辑样式
@property (nonatomic, readonly) UITableViewCellEditingStyle editingStyle;
14.是否显示reordering控件
@property (nonatomic) BOOL showsReorderControl;
15.
@property (nonatomic) BOOL shouldIndentWhileEditing;
16.附加控件类型
@property (nonatomic) UITableViewCellAccessoryType accessoryType;
17.自定制附加控件
@property (nonatomic, strong, nullable) UIView *accessoryView;
18.编辑状态下的附加控件类型
@property (nonatomic) UITableViewCellAccessoryType editingAccessoryType;
19.自定制编辑状态下的附加控件
@property (nonatomic, strong, nullable) UIView *editingAccessoryView;
20.缩进层级,default is 0
@property (nonatomic) NSInteger indentationLevel;
21.缩进宽度,default is 10.0
@property (nonatomic) CGFloat indentationWidth;
22.分割线的位置
@property (nonatomic) UIEdgeInsets
23.编辑模式
@property (nonatomic, getter=isEditing) BOOL editing;
- (void)setEditing:(BOOL)editing animated:(BOOL)animated;
24.是否显示删除按钮
@property(nonatomic, readonly) BOOL showingDeleteConfirmation;
25.UItableViewCell的聚焦类型
@property (nonatomic) UITableViewCellFocusStyle focusStyle NS_AVAILABLE_IOS(9_0) UI_APPEARANCE_SELECTOR;
26.
- (void)willTransitionToState:(UITableViewCellStateMask)state NS_AVAILABLE_IOS(3_0);
- (void)didTransitionToState:(UITableViewCellStateMask)state NS_AVAILABLE_IOS(3_0);
联系客服