我正在为我的分辨率设置制作一个下拉列表。我以编程方式填充它,完成后刷新它,以便滚动条将从当前选定的值开始。
但是,这不起作用,滚动条始终从顶部开始,即使所选值位于底部也是如此。
法典:
public TMP_Dropdown resolutionDd;
//...
resolutionDd.AddOptions(options);
resolutionDd.value = currentResolutionIndex;
resolutionDd.RefreshShownValue();
这是一个错误还是我错过了什么?
如果你使用Firebase,(我的情况(使用外部调用,例如:
fs.Collection("app").GetSnapshotAsync().ContinueWith(it =>
{
if (it.IsCompleted)
{
if (it.Result.Count > 0)
{
documents = it.Result;
}
}
});
private void Update()
{
if (documents != null)
{
//actualize here all data
resolutionDd.RefreshShownValue();
documents = null;
}
}