JSPatch

//更改背景色
//JS
var redColor = UIColor.redColor();
self.setBackgroundColor(redColor);
//mesonry
require('UICollectionViewCell,UIColor,UIImageView,UIView')

defineClass("CategoryVideoCell",{
            
        drawCell: function() {
            
            var filmImgView = self.filmImgView();
            filmImgView = UIImageView.alloc().init();
            self.addSubview(filmImgView);
            filmImgView.mas__makeConstraints(block('MASConstraintMaker *',function(make){
                                                   
                                               make.left().mas__equalTo()(self.mas__left()).offset()(0);
                                               make.right().mas__equalTo()(self.mas__right()).offset()(0);
                                               make.top().mas__equalTo()(self.mas__top()).offset()(0);
                                               make.bottom().mas__equalTo()(self.mas__top()).offset()(99.5);
                                                   
                                                  }
                                                  
                                            )
                                            
            );
            
            
        }
            
})

你可能感兴趣的:(JSPatch)