99re热这里只有精品视频,7777色鬼xxxx欧美色妇,国产成人精品一区二三区在线观看,内射爽无广熟女亚洲,精品人妻av一区二区三区

ctr.md

2018-11-22 17:57 更新

ngui/ctr

empty

  • 這是一個(gè)常量空view xml,描述一個(gè)無(wú)子視圖的View

isEmpty(vx)

  • vx是否等于empty空視圖數(shù)據(jù)

New(vx[,parent[,...args]])

New(vx[,...args])

  • 通過(guò)vx描述數(shù)據(jù)創(chuàng)建視圖或視圖控制器

  • @arg vx {Object} view xml描述數(shù)據(jù)
  • @arg [parent] {View} 傳入父視圖時(shí)將新創(chuàng)建的視圖加入到它的結(jié)尾
  • @arg [...args] 視圖的構(gòu)造參數(shù)
  • @ret {View|ViewController}

Example:

import { GUIApplication, ViewController, Root, Div } from 'ngui'
import 'ngui/http'
class MyCtr extends ViewController {
    loadView() {
        http.get('http://192.168.1.100:1026/README.md?param=' + this.message.param, bf=>{
            super.loadView(
                <Div width=100 height=100 backgroundColor="#f00">
                    ${bf.toString('utf8')}
                </Div>
            )
        })
    }
}
new GUIApplication().start(
    <Root>
        <ViewController vdata={ divWidth: 200, divCon: 'Hello' }>
            <Div width=%{vd.divWidth} height=100 backgroundColor="#000">
                %{vd.divCon}
            </Div>
        </ViewController>
        <MyCtr message={param:10} />
    </Root>
);

Class: ViewController

視圖控制器,與視圖綁定后視圖變成關(guān)鍵視圖,當(dāng)前控制器有可稱為成員視圖控制器,

關(guān)鍵視圖下面所有后代視圖以及子視圖控制器都屬于這個(gè)作用域中的成員,

成員視圖的top屬性都指向當(dāng)前綁定的關(guān)鍵視圖,成員視圖的topCtr以及子視圖控制器的parent都指向當(dāng)前視圖控制器,

如果這些成員有具名的id,可以通過(guò)當(dāng)前視圖控制器find(id)找到這些成員

ViewController.onLoadView

  • 載入視圖完成時(shí)觸發(fā)

ViewController.onViewDataChange

  • 視圖數(shù)據(jù)變化時(shí)觸發(fā),如果有視圖關(guān)注這個(gè)數(shù)據(jù),那么它也會(huì)發(fā)生改變

ViewController.onRemoveView

  • 綁定的視圖從父視圖刪除時(shí)觸發(fā)

ViewController.constructor([msg])

  • 構(gòu)造函數(shù)

  • @arg [msg] {Object} 傳入可選的消息對(duì)像

ViewController.find(id)

  • 通過(guò)id查找成員視圖或成員控制器

ViewController.message

  • 控制器消息對(duì)像

ViewController.vdata

  • 控制器視圖數(shù)據(jù)

Get: ViewController.parent

  • 獲取父控制器

ViewController.view

  • 獲取或設(shè)置當(dāng)前控制器綁定的視圖

ViewController.id

  • 獲取或設(shè)置一個(gè)id,這個(gè)id在同一個(gè)作用域中不能重復(fù)

  • 可通過(guò)id在父視圖控制器中查詢子控制器

ViewController.loadView(vx)

  • 通過(guò)vx數(shù)據(jù)載入視圖,這是個(gè)相當(dāng)重要的方法,所有gui視圖載入創(chuàng)建以及視圖數(shù)據(jù)的綁定都在這個(gè)方法中完成,

重寫(xiě)ViewController類與該方法來(lái)實(shí)現(xiàn)自定義組件。

  • 這個(gè)方法調(diào)用完成會(huì)觸發(fā)onloadView事件

View proxy events

  • 這些事件都為代理視圖的快捷方式,需要綁定的視圖支持這些事件

ViewController.onBack

ViewController.onClick

ViewController.onTouchstart

ViewController.onTouchmove

ViewController.onTouchend

ViewController.onTouchcancel

ViewController.onKeydown

ViewController.onKeypress

ViewController.onKeyup

ViewController.onKeyenter

ViewController.onFocus

ViewController.onBlur

ViewController.onHighlighted

ViewController.onFocusMove

ViewController.onScroll

ViewController.onActionKeyframe

ViewController.onActionLoop

ViewController.onWaitBuffer

ViewController.onReady

ViewController.onStartPlay

ViewController.onError

ViewController.onSourceEof

ViewController.onPause

ViewController.onResume

ViewController.onStop

ViewController.onSeek

View proxy methods and properties

  • 代理視圖的快捷方法與屬性

ViewController.action

ViewController.style

ViewController.visible

ViewController.receive

ViewController.class

ViewController.transition(style[,delay[,cb]])

ViewController.transition(style[,cb])

ViewController.show()

ViewController.hide()

ViewController.addClass(name)

ViewController.removeClass(name)

ViewController.toggleClass(name)

ViewController.remove()

以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)