什么是“android.R.layout.simple_list_item_1"? [英] What is "android.R.layout.simple_list_item_1"?
本文介绍了什么是“android.R.layout.simple_list_item_1"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经开始学习 Android 开发,并且正在学习一本书中的 todolist 示例:
I've started learning Android development and am following a todolist example from a book:
// Create the array list of to do items
final ArrayList<String> todoItems = new ArrayList<String>();
// Create the array adapter to bind the array to the listView
final ArrayAdapter<String> aa;
aa = new ArrayAdapter<String>( this,
android.R.layout.simple_list_item_1,
todoItems
);
myListView.setAdapter(aa);
我无法完全理解这段代码,尤其是这一行:
I can't understand exactly this code especially this line:
android.R.layout.simple_list_item_1
推荐答案
Zakaria,这是对内置 XML 布局文档的引用,该文档是 Android 操作系统的一部分,而不是您自己的 XML 布局之一.
Zakaria, that is a reference to an built-in XML layout document that is part of the Android OS, rather than one of your own XML layouts.
>
以下是您可以使用的更多布局列表:http://developer.android.com/reference/android/R.layout.html
(更新链接感谢@Estel:https://github.com/android/platform_frameworks_base/tree/master/core/res/res/layout )
您实际上可以查看布局的代码.
You can actually view the code for the layouts.
这篇关于什么是“android.R.layout.simple_list_item_1"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文