[]自己创建的box作为tab,为啥没有点击事件啊?



var Loader = laya.net.Loader;
var UI;

Laya.init(600, 400);
Laya.loader.load("res/atlas/template/comp.json", Laya.Handler.create(this, onAssetLoaded2), null, Loader.ATLAS);

function onAssetLoaded2()
{
    Laya.class(MyBoot, "MyBootClass", MyPage2UI);
    var UI = new MyBootClass();
    Laya.stage.addChild(UI);
}

function MyBoot()
{
    MyBoot.super(this);
    this.MyTab.selectHandler = new Laya.Handler(this, onSelect, null, false);//设置 tab 的选择项发生改变时执行的处理器。
    console.log("A123");
    function onSelect(index)
    {
        console.log("当前选择的标签页索引: index= ", index);
    }
}


已邀请:

cuixueying

赞同来自:

自定义Tab组件,不支持Box组件作为Item
只支持 Button、radio、checkbox 具备点击状态的组件作为子项Item

lxm75

赞同来自:

明白了,谢谢

要回复问题请先

商务合作
商务合作