【问题标题】:ListView item value change when I swip screen..Unity滑动屏幕时ListView项目值发生变化..Unity
【发布时间】:2018-06-08 16:19:39
【问题描述】:

我是团结的新人。我统一创建了一个项目,我在列表视图中绑定了一些项目,在一个项目中我使用两个不同的图像并在单击该项目时进行更改。它工作正常..但是当我转到其他选项卡(或浏览器)并返回统一时,该项目将更改为默认状态..

Default state of image

Changing state of image

【问题讨论】:

    标签: unity3d


    【解决方案1】:

    不知道如何实现标签切换。

    保持按钮状态的一种简单方法是使用PlayerPrefs

    // before click other tab
    PlayerPrefs.SetInt("BtnStatus", someitem.status);
    
    // after come back
    someitem.status = PlayerPrefs.GetInt("BtnStatus", 0);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-06-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-07
      相关资源
      最近更新 更多