嗨,我有我的Android应用程序的问题。问题是当我尝试设置新的视图。未知的充气错误与android
public View getView(int position, View convertView, ViewGroup parent) {
View v = convertView;
if (v == null) {
try{
LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(R.layout.list, null);
}
catch(Exception e){
String a=e.toString();
}
}
in line v = vi.inflate(R.layout.list,null);我得到这个错误:
android.view.InflateException: Binary XML file line #5: Error inflating class <unknown>
这也是我list.xml文件:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TableRow
android:layout_width="fill_parent"
android:layout_height="15dp"
android:background="@drawable/bg_seznam" >
<TextView
android:id="@+id/item_title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="17dp"
android:textColor="#ffffff"
android:textSize="20dp"
android:textStyle="bold"
android:typeface="serif" >
</TextView>
</TableRow>
</TableLayout>
所以任何想法?
总共有同样的结果:S – gabrjan 2012-08-07 13:58:40
'bg_seznam'如何绘制?它是一个图像或XML可绘制? – StenaviN 2012-08-07 14:07:22
这是一个.png图像 – gabrjan 2012-08-07 14:11:15