在android中arrayadapter这个类为什么有中括号?
android里面的一个类,可是为什么使用的时候有〈〉呢?ArrayAdapter<String>_adapter=newArrayAdapter<String>(thi...
android里面的一个类,可是为什么使用的时候有〈〉呢?
ArrayAdapter<String> _adapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item,spinnerItem);
googleAndroid文档写的是:
A concrete BaseAdapter that is backed by an array of arbitrary objects. By default this class expects that the provided resource id references a single TextView. If you want to use a more complex layout, use the constructors that also takes a field id. That field id should reference a TextView in the larger layout resource.
However the TextView is referenced, it will be filled with the toString() of each object in the array. You can add lists or arrays of custom objects. Override the toString() method of your objects to determine what text will be displayed for the item in the list.
不知道什么意思!!
求教! 展开
ArrayAdapter<String> _adapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item,spinnerItem);
googleAndroid文档写的是:
A concrete BaseAdapter that is backed by an array of arbitrary objects. By default this class expects that the provided resource id references a single TextView. If you want to use a more complex layout, use the constructors that also takes a field id. That field id should reference a TextView in the larger layout resource.
However the TextView is referenced, it will be filled with the toString() of each object in the array. You can add lists or arrays of custom objects. Override the toString() method of your objects to determine what text will be displayed for the item in the list.
不知道什么意思!!
求教! 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询