打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
【iOS学习】UITableViewCell.h阅读笔记

 #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);


本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
WKWebView与JS交互实战技巧之API介绍
UIView 文档
iOS App开发中UIViewController类的使用教程
iOS中管理剪切板的UIPasteboard粘贴板类用法详解
iOS UITabBarController
iOS Cell嵌套UIWebView(内附UIWebView详解)
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服