相关疑难解决方法(0)

如何实现视图持有者?

我使用视图来显示动态arrayadapter.it工作但我滚动列表时显示的数据不规则变化.我希望我的列表视图只能填充一次,而不是所有的时间我滚动我的列表.有什么建议吗?这是我的代码

public View getView(int position, View convertView, ViewGroup parent) {            

   // A ViewHolder keeps references to children views to avoid unneccessary calls            
   // to findViewById() on each row.            
   ViewHolder holder;            
   // When convertView is not null, we can reuse it directly, there is no need            
   // to reinflate it. We only inflate a new View when the convertView supplied            
   // by ListView is null.            

   if (convertView == null) {                

    convertView = mInflater.inflate(R.layout.sample, null);   
    // Creates a ViewHolder and …
Run Code Online (Sandbox Code Playgroud)

android listview view

11
推荐指数
2
解决办法
4万
查看次数

Android应用程序开发中的充气机

任何人都可以告诉什么是Inflator是什么以及如何在Android应用程序中使用它?

我不知道它的确切用法以及为什么使用它.

android

10
推荐指数
2
解决办法
1万
查看次数

标签 统计

android ×2

listview ×1

view ×1