2011-12-15 28 views
11

Bu yüzden android.view.ViewGroup içine nereye döküm olduğunu göremiyorum Grafik görünümde xml görüntülemek çalıştığımda bu hata iletisini alıyorum. Ben de gerçek java'ya ait bir şey yapmadım.android.widget.TextView android.view.ViewGroup için dönüştürülemiyor

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:background="#ffffffff" 
android:orientation="vertical" > 

<TableLayout 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:layout_gravity="center" 
    android:stretchColumns="1" > 

    <TableRow 
     android:layout_width="fill_parent" 
     android:layout_height="1.0dp" 
     android:background="@drawable/list_divider_holo_light" /> 

    <TableRow 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" > 

Bu elemanlarla bir stil yapmaktan bıktım ve bunu kabul etmedi.

 <TextView 
      android:id="@+id/textView1" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_gravity="center_vertical" 
      android:layout_marginLeft="25dp" 
      android:text="@string/add_alarm" 
      android:textAppearance="?android:attr/textAppearanceSmall" 
      android:textColor="#ff505050" 
      android:textSize="18.0sp" /> 

     <Button 
      android:id="@+id/bSetTimer" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_gravity="center_vertical" 
      android:layout_marginLeft="100.0dp" 
      android:text="Button" /> 
    </TableRow> 

    <Button 
     android:id="@+id/bSetAlarm" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="Button" /> 

    <TextView 
     android:id="@+id/textView2" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:text="Small Text" > 

     <TableRow 
      android:layout_width="fill_parent" 
      android:layout_height="2.0dp" 
      android:background="@drawable/list_divider_holo_light" /> 

     <TableRow 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:paddingTop="10dp" > 

      <TextView 
       android:layout_height="20.0dp" 
       android:layout_gravity="center_horizontal" 
       android:layout_marginLeft="40.0dp" 
       android:paddingLeft="25.0dip" 
       android:text="@string/alarm_volume_title" /> 
     </TableRow> 

     <SeekBar 
      android:id="@+id/default_volume_seekbar" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginLeft="15.0dp" 
      android:paddingTop="2.0dip" /> 
    </TextView> 
</TableLayout> 

cevap

21

metin görünümü textView2kapalı (sadece tablo layout kapatmadan önce olduğu) bir sırayla ve çalışma zamanı bir viewgroup için döküm çalışıyor 2 tablo satırlarını eklemek değildir ve seekbar.

+0

oh .... wow benim textView1 içinde arıyordum ... Haha teşekkür ederim! – domshyra

5

TextView (@+id/textView2) ürününüzün içine başka öğeler yerleştirmeye çalışıyorsunuz. Bu geçerli değil çünkü hata dediği gibi, ViewGroup değil.

+0

Ah çok teşekkür ederim :) – domshyra

İlgili konular