亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Inflater和循環不起作用

Inflater和循環不起作用

千萬里不及你 2019-03-13 16:15:21
在我app上的自定義視圖上有問題,我知道這個很可能是和inflaters有關系,但是我不知道怎么解決。inflater剛剛還是好的,但是它應該是做三次循環,現在卻只有一次,這樣在我最終布局上我只能得到一個view相關部分代碼是下邊這個 void populate(String strcline, String url){ lLfD = (LinearLayout)findViewById(R.id.lLfD);     try{     JSONArray a1 = new JSONArray(strcline);     for(int i = 0; i < a1.length(); i++){         JSONArray a2 =  a1.getJSONArray(i);         final String fUserId = a2.getString(0);         String userName = a2.getString(1);         String userPicture = url + a2.getString(2);         View child = getLayoutInflater().inflate(R.layout.cellevery, lLfD);         ImageView avatar = (ImageView)findViewById(R.id.cellAvatar);         downloadFile(userPicture, avatar);         TextView cellName = (TextView)findViewById(R.id.cellName);         cellName.setText(userName);         lLfD.addView(child);     }     }catch(Exception e){     }     pDialog.dismiss(); }
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 351 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號