SORU
9 Temmuz 2010, Cuma


android düzeni: Bu etiket ve çocuk </> TextView; ve bir bileşik tarafından değiştirilebilir drawable

Belirli bir XML dosyası düzeni çalıştırdığımda bu çıkıyor:

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

Değiştirmek ne aşağıdaki xml kodu için yapılmalıdır:

<LinearLayout android:id="@ id/name_layout"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:gravity="center_vertical"
                android:background="@drawable/grouplist_single_left_grey_area" >
                <ImageView android:id="@ id/photo_image"
                    android:layout_width="@dimen/thumbnail_width"
                    android:layout_height="@dimen/thumbnail_height"
                    android:paddingBottom="5dip"
                    android:paddingTop="5dip"
                    android:paddingRight="5dip"
                    android:paddingLeft="5dip"
                    android:layout_marginRight="5dip"
                    android:clickable="true"
                    android:focusable="true"
                    android:scaleType="fitCenter"
                    android:src="@*android:drawable/nopicture_thumbnail"
                    android:background="@drawable/photo_highlight" />
                <TextView android:id="@ id/name"
                    android:paddingLeft="5dip"
                    android:layout_weight="1"
                    android:layout_width="0dip"
                    android:layout_height="wrap_content"
                    android:gravity="center_vertical"
                    android:textAppearance="?android:attr/textAppearanceLarge" />
            </LinearLayout>

Bu şekilde ekranda görünüyor nasıl:

enter image description here

Kamera simgesini varsayılan. Buna tıklayarak kullanıcı başka bir resim seçmek için bir seçenek verecektir.

CEVAP
9 Temmuz 2010, Cuma


TextView birleştirme ve içine ImageView, TextView kullanarak setCompoundDrawable*() yöntemleri android:drawableLeft kullanarak.

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • hitcreatormusic2

    hitcreatormu

    21 Mayıs 2010
  • Matthew Smith

    Matthew Smit

    24 Mayıs 2010
  • Submissions101

    Submissions1

    23 ŞUBAT 2007