//-------∽-★-∽------∽-★-∽--------∽-★-∽ListView∽-★-∽--------∽-★-∽------∽-★-∽--------// void ShowListView() { GameObject container = GameObjUtil.FindChild(m_scrollViewItemList.gameObject, "Image_mask/Container_content"); List <int> datas = new List <int>(); int num = 10; for (int i = 0; i < num; ++i) { datas.Add(i); } m_listView = ComponentUtil.EnsureComponent <KListView>(container); m_listView.itemViewType = typeof(Item1); m_listView.onDataChanged.AddListener(UpdateListItem); LayoutParam param = m_listView.layoutParam; //param.padding = new Padding(20, 20, 20, 20); param.itemGap = new Vector2(10, 50); //param.divNum = 2; m_listView.ShowList(datas); }
//-------∽-★-∽------∽-★-∽--------∽-★-∽ApplyGameObjectParam∽-★-∽--------∽-★-∽------∽-★-∽--------// public override void ApplyGameObjectParam(GameObject go, JsonData data) { base.ApplyGameObjectParam(go, data); //都是延时创建 //if (HasParam(data, PATTERN_PAGEABLE) == true) //{ // AddBuildHelper(go, PARAM_PAGEABLE); //} //if (HasParam(data, PATTERN_SHRINK) == true) //{ // AddBuildHelper(go, PARAM_SHRINK); //} KListView listView = go.AddComponent <KListView>(); }