JSPatch 응용 프로그램.

1285 단어
//1.require('UIView')
require('UIColor')
defineClass('ViewController',{
     initsubviews: function(){
        
        var myview = UIView.alloc().init();
        
        myview.setFrame({x:20, y:20, width:100,height:100});

        myview.setBackgroundColor(UIColor.redColor());
        
        self.view().addSubview(myview);
   
        }
     
    },{
      
});

//2
initProperty: function(){
        self.setTitleStr("str");
        
       var myString = self.titleStr();
        
        console.log(self.titleStr().toJS());

        console.log(myString.toJS());
    
        }

//3수 그룹
self.setMuarr(NSMutableArray.alloc().init());         
     self.muarr().addObject("jspatch");
        
        console.log(self.muarr().toJS());

 self.setValue_forKey("myname","_testStr");
        
    console.log(self.valueForKey("_testStr"));

//4 하위 요소 삭제view
        var arr = cell.subviews().toJS();
        
   
        for(var i = 0;i < arr.length;i++){
        
        
        
        if (arr[i].tag() == 1001) {
        arr[i].removeFromSuperview();
        }
        
        }

좋은 웹페이지 즐겨찾기