布局修改就保存


====================问题描述====================
<TableRow
 android:background="#ffffff"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" >

   <CheckBox
            android:id="@+id/checkchargekind"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:button="@null"
            android:background="#ffffff"
             android:textColor="#000000"
              android:textSize="20dp" 
             android:drawableRight="@layout/mycheckbox"
        android:gravity="right|center_vertical"
            android:text="送货" />
   <TextView
         android:id="@+id/songhuofei"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="#ffffff"
                android:gravity="left"
                android:layout_marginLeft="13dip"
                android:text="送货费:"
                 android:textColor="#000000"
                android:textCursorDrawable="@null"
                android:textSize="20dp" />
   <CheckBox
            android:id="@+id/checktransfer"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:button="@null"
            android:layout_marginLeft="13dip"
            android:background="#ffffff"
             android:textColor="#000000"
              android:textSize="20dp" 
             android:drawableRight="@layout/mycheckbox"
        android:gravity="right|center_vertical"
            android:text="中转" />
   <TextView
    android:id="@+id/md"
     android:background="#ffffff"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:gravity="left"
                 android:layout_marginLeft="13dip"
                android:text=""
                 android:textColor="#000000"
                android:textCursorDrawable="@null"
                android:textSize="20dp" />
     </TableRow>

我就是把android:id="@+id/songhuofei" 这个TextView重被别的地方移到这个TableRow里了
结果走到checktransfer=(CheckBox) findViewById(R.id.checktransfer);  
就给我报android.widget.TextView cannot be cast to android.widget.CheckBox
这个错误


====================解决方案1====================
那就用TextView接一下打印出他的值来看看是什么
posted @ 2014-09-30 16:10  android开发教程2015  阅读(210)  评论(0编辑  收藏  举报
我要啦免费统计