iOS 在所需要创建的Cell和原生Cell相差不大并且需要accessoryView的图片自定义时,修改tableViewCell上面accessoryView的默认图片及位置
newsCell.accessoryView = ({
UIImageView *imgV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"listen_voise"]];
CGRect frame = imgV.frame;
frame.size.width = frame.size.width + 10 *SCALE_WIDTH;
imgV.frame = frame;
[imgV setContentMode:UIViewContentModeLeft];
imgV;
});
网友评论