Ich bekomme ein zusätzliches Symbol beim Hinzufügen von ImageView in einer ListView wie unten gezeigt. Was ist das und wie kann ich es entfernen? ImageView in ListView gibt zusätzliches Bild
In meinem Inhalt es zeigt auch, und wenn sie ausgewählt es unterstreicht die Image hier gezeigten
Der Code xml ist hier:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="anaxin.newshellas.Feed"
tools:showIn="@layout/activity_feed">
<ListView
android:choiceMode="singleChoice"
android:listSelector="@android:color/darker_gray"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/feedView"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:clickable="false" />
<TextView
android:id="@+id/textTop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:textStyle="bold"
/>
<TextView
android:id="@+id/textBot"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="12sp"
android:layout_below="@+id/textTop"
/>
<ImageView
android:layout_below="@+id/textTop"
android:layout_alignParentRight="true"
android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/image"
/>
</RelativeLayout>
Ich benutze einen SimpleAdapter mit zwei Reihen (TEXTTOP , TextBot), um mein listView wie folgt zu füllen:
final SimpleAdapter adapter = new SimpleAdapter(this, data, R.layout.content_feed,
new String[]{"First Line", "Second Line"},
new int[]{R.id.textTop, R.id.textBot}) {
public View getView(int position, View convertView, ViewGroup parent) {
View view = super.getView(position, convertView, parent);
return view;
}
};
Und ich n Methode zum Hinzufügen von Elementen dieser Teil
Welches Bild wird mit 'android: src =" @ drawable/image "'? Hast du versucht, das zu entfernen? –
Ich denke, listView Artikellayout ist anders .. Dieses Layout ist anders. Entfernen oder kommentieren Sie ImageView in diesem Layout. –
Haben Sie auch eine Bildansicht innerhalb des Adapters? entferne die Bildansicht in diesem Layout und behalte die, die du in dem Adapter hast –