UITableViewCell 基础编

           1.属性

            imageView:图片视图

            textLabel:文本标签

            detailTextLabel:详细文本标签

            contentView:内容视图

            backgroundView:背景视图

            selectedBackgroundView:选择视图

            multipleSelectionBackgroundView:多选择情况下背景视图

            reuseIdentifier: 重用标识符

            selectionStyle:选中选中颜色 (一共有四种情况:UITableViewCellSelectionStyleNone,UITableViewCellSelectionStyleBlue,UITableViewCellSelectionStyleGray,UITableViewCellSelectionStyleDefault )

            selected:是否能够选中

            highlighted:高亮状态

            editingStyle:编辑模式 (一共三种情况:UITableViewCellEditingStyleNone,UITableViewCellEditingStyleDelete,UITableViewCellEditingStyleInsert)

            showsReorderControl:是否重新排列   (一般在编辑模式下面使用)

            shouldIndentWhileEditing:编辑模式下是否需要对表视图指定行进行缩进

            accessoryType:附件风格 (一共五种情况:UITableViewCellAccessoryNone,  UITableViewCellAccessoryDisclosureIndicator,UITableViewCellAccessoryDetailDisclosureButton ,UITableViewCellAccessoryCheckmark,                             UITableViewCellAccessoryDetailButton)

            accessoryView:附件视图 (可以根据自己的需求定义)

            editingAccessoryType:编辑模式下附件风格

            editingAccessoryView:编辑模式下附件视图

            indentationLevel:文本缩进级别 (缩进几次,添加其他控件使原来空间大小不够用)

            indentationWidth:每次缩进宽度

            separatorInset:分割线样式

            editing:是否能够编辑

            showingDeleteConfirmation:是否目前正在显示删除按钮

            focusStyle:单元格主要风格 (iOS9加入)

            2.方法

            - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(nullable NSString *)reuseIdentifier;初始化cell

            - (nullable instancetype)initWithCoder:(NSCoder *)aDecoder;反归档

            - (void)prepareForReuse;cell被重用之后调用的方法

            - (void)setSelected:(BOOL)selected animated:(BOOL)animated;点击cell的动画效果

            - (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated;设置高亮效果

            - (void)setEditing:(BOOL)editing animated:(BOOL)animated;设置编辑模式

            - (void)willTransitionToState:(UITableViewCellStateMask)state; cell状态将要转换时调用的函数
            - (void)didTransitionToState:(UITableViewCellStateMask)state; cell状态已经转换时调用的函数

  

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值