嗨,我有我的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