[英]How to make a ListView in android with images in it?
I need an organized way to organize my app and buttons are starting to look sloppy in my opinion. 我需要一种井井有条的方式来组织我的应用程序,我认为按钮开始显得草率。 Below is my code.
下面是我的代码。 I have the XML set up to a List View.
我将XML设置为列表视图。 Not sure if it is right or not.
不确定是否正确。
</LinearLayout>
Here is my java code. 这是我的Java代码。 I didn't change it yet,, except for the imports from previous attempts to do this.
除了以前尝试进行的导入以外,我尚未进行任何更改。 package com.apw.listview.test;
包com.apw.listview.test;
import android.app.*;
import android.os.*;
import android.view.*;
import android.widget.*;
import android.content.*;
public class Species extends Activity
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.species);
}
}
使用ListView的最佳方法是使用适配器,例如,请参见该教程: http : //www.vogella.com/tutorials/AndroidListView/article.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.