Soru & Cevap

ListView Özelleştirme Sorunu ...

18.02.2014 - 01:42

Merhabalar.

Android 301 eğitiminde ListView Özelleştirme konusunda bir sıkıntı yaşıyorum. satirlayout.xml dosyasını anlatıldığı şekilde yazdığımda şu hatayı alıyorum:

This tag and its children can be replaced by one <TextView/> and a compound drawable

Kod şu şekilde:

[code]<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal" >
 
    <ImageView
       android:id="@+id/simge"
       android:layout_width="48dp"
       android:layout_height="48dp" />
 
    <TextView
       android:id="@+id/isimsoyisim"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content" />
 
</LinearLayout>[/code]

 

6 Görüntülenme

1 Cevap

Sitedeki sorulara cevap verebilmek için giriş yapın ya da üye olun.

picture-3606-1408610132.jpg
cgural
18.02.2014 - 02:21

Merhaba,

Aslında bu bir sorun ya da hata değil, öneri. Android Lint size diyor ki "bu LinearLayout içinde bir ImageView ve TextView bulunduruyorsun. Aslında böyle ayrı ayrı yapmana gerek yok. Böyle bir yerleşimi tek TextView ile de yapabilirsin"

Şurada bununla ilgili bir tartışma var: http://stackoverflow.com/questions/3214424/android-layoutopt-this-tag-and-its-children-can-be-replaced-by-one-textview

Muhammed Murat Tutar
19.02.2014 - 05:44
Çok teşekkür ederim.