0
您好,我想將圖像添加到我的列表視圖中。 我該怎麼做? XML代碼 list.xml如何添加圖像到我的列表視圖
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/nom"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/email2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
Java代碼
我試圖用代碼的註釋,但它不工作
private void showEmployee(String json){
try {
JSONArray result = new JSONArray(json);
JSONObject c = result.getJSONObject(0);
String ref = c.getString("Reference");
String loginr = c.getString("Login");
String prix = c.getString("Prix");
String quantite = c.getString("Quantite");
String prixT = c.getString("PrixT");
String dateCom = c.getString("DateCom");
editRef.setText(ref);
editLogin.setText(loginr);
editprixu.setText(prix);
editQt.setText(quantite);
editprix.setText(prixT);
editdate.setText(dateCom);}
趕上(JSONException E){ Ë .printStackTrace();}
在此先感謝
您需要嘗試獲取至少一小部分Android開發知識。 –