码迷,mamicode.com
首页 > 其他好文 > 详细

UITableView侧滑效果(1)上面文字下面图片的效果

时间:2017-07-04 13:16:00      阅读:106      评论:0      收藏:0      [点我收藏+]

标签:data-   apt   color   mat   round   import   asp   height   cells   

//自定义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];

}

//实现上面文字下面图片

-(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];

}

}

}

 

技术分享
 

UITableView侧滑效果(1)上面文字下面图片的效果

标签:data-   apt   color   mat   round   import   asp   height   cells   

原文地址:http://www.cnblogs.com/linfeifei/p/7116004.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!