gpt4 book ai didi

java - 什么是资源:0 doing?

转载 作者:行者123 更新时间:2023-12-02 10:44:28 25 4
gpt4 key购买 nike

我不明白这里的0有什么用。它到底在做什么?

public WordAdapter(Activity nmbersActivity, ArrayList<Word> word) {
super(nmbersActivity,0,word);
}

我检查了文档,但找不到它到底是什么。

在实现中,这是代码。

public ArrayAdapter(@NonNull Context context, @LayoutRes int resource,
@NonNull List<T> objects) {
this(context, resource, 0, objects);
}

最佳答案

来自docs :

The id of the TextView within the layout resource to be populated

ArrayAdapters 通常用在列表中,因此包含文本资源 ID 来显示项目标题。传递 0 表示没有 TextView 资源的默认状态。

关于java - 什么是资源:0 doing?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52685512/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com