UITableView側(cè)滑實現(xiàn)(2)實現(xiàn)上面文字下面圖片

//自定義TableviewCell

#import "OrderViewCell.h"

#import "Masonry.h"

@implementation OrderViewCell

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier

{

self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];

if (self)

{


}

return self;

}

//cell上面view

-(void)layoutSubviews{

[super layoutSubviews];

[self modifiDeleteBtn];

}

//實現(xiàn)上面文字下面圖片

-(void)modifiDeleteBtn{

for (UIView *subView in self.subviews)

{

if ([subView isKindOfClass:NSClassFromString(@"UITableViewCellDeleteConfirmationView")]){

//確認訂單

UIView *confirmationView = subView.subviews[3];

confirmationView.backgroundColor = [UIColor colorWithRed:164/255.0 green:225/255.0 blue:225/255.0 alpha:1.0];

for (UIView *view in confirmationView.subviews) {

UIImageView *deleteImage = [[UIImageView alloc] init];

deleteImage.contentMode = UIViewContentModeScaleAspectFit;

deleteImage.image = [UIImage imageNamed:@"confirmOrder"];

deleteImage.frame = CGRectMake(5, -10, 20, 20);

[view addSubview:deleteImage];

UIButton *oneBtn = [UIButton buttonWithType:UIButtonTypeCustom];

oneBtn.frame = CGRectMake(-25, 5, 80, 30);

[oneBtn setTitle:@"確認訂單" forState:UIControlStateNormal];

oneBtn.titleLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:10];

[view addSubview:oneBtn];

}

}

}


最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內(nèi)容