我正在开发android应用程序。现在我必须创建报纸的应用程序。所以在主页上,我必须显示图片和文字的头条新闻。现在我的问题是,应该有这么多的头条新闻,所以我使用水平滚动条来查看其他新闻。现在我的想法是当用户向左或向右滚动时加载图像和文本。是否可以这样做,或者我必须在创建活动时加载所有数据。任何帮助或建议都是非常感谢的。
发布于 2012-03-13 15:44:05
如果你问的是延迟加载,那么你需要使用AsyncTask
,因为它是实现它的最简单的方法。
class Download extends AsyncTask<Integer,Integer,Integer>{
protected Integer doInBackground(Integer... wat) {
//Your downloading stuff
}
protected Integer onPostExecute(Integer result){
//Create listview in UI Thread
}
}
创建水平ListView read here的步骤
https://stackoverflow.com/questions/9679885
复制相似问题