Iphone 当';删除';按钮出现

Iphone 当';删除';按钮出现,iphone,objective-c,uitableview,uilabel,Iphone,Objective C,Uitableview,Uilabel,当出现Delete按钮时,是否有人知道调整子视图(即UILabelView)大小的方法 可以有两种方法: 1.当按钮出现在UITableViewCell中时,捕获通知(如果有) 2.告诉框架自动重新排列它。在UITableViewCell类的.m文件中,使用LayoutSubView。每次调整单元格大小、显示/消失“删除”按钮以及其他操作时,都会调用该函数: - (void) layoutSubviews { [super layoutSubviews]; frame =

当出现
Delete
按钮时,是否有人知道调整子视图(即UILabelView)大小的方法

可以有两种方法:

1.当按钮出现在UITableViewCell中时,捕获通知(如果有)
2.告诉框架自动重新排列它。

在UITableViewCell类的.m文件中,使用LayoutSubView。每次调整单元格大小、显示/消失“删除”按钮以及其他操作时,都会调用该函数:

- (void) layoutSubviews {

    [super layoutSubviews];


    frame = self.contentView.bounds; ///this is the availalbe space for the cell
    ///it's automatically adjusted when the delte button appears
    ///so use it to resize all of your interface elements
}

您还可以在布局子视图内部使用
if(self.editing){
进行更多控制。

在UITableViewCell类的.m文件中,使用布局子视图。每次调整单元格大小时,都会调用它,删除按钮会出现/消失,等等:

- (void) layoutSubviews {

    [super layoutSubviews];


    frame = self.contentView.bounds; ///this is the availalbe space for the cell
    ///it's automatically adjusted when the delte button appears
    ///so use it to resize all of your interface elements
}
您还可以在LayoutSubview内部使用
if(self.editing){
,以获得更多控制