0

我尝试在我自己的 android projet 中添加 android coverflow

当 myt 活动启动时,我收到以下错误:

06-18 15:32:35.690: E/AndroidRuntime(15146): 
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.accessdev.myproject/com.accessdev.myproject.MainTMP_Activity}: java.lang.RuntimeException: Unable to start activity 

ComponentInfo{com.accessdev.myproject/com.accessdev.myproject.BonsPlansActivity}: android.view.InflateException: Binary XML file line #7: Error inflating class pl.polidea.coverflow.CoverFlow

我的布局文件:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="fill_parent">



<view class="pl.polidea.coverflow.CoverFlow" xmlns:coverflow="http://schemas.android.com/apk/res/com.accessdev.myproject"
    coverflow:imageWidth="100dip" coverflow:imageHeight="150dip" android:id="@+id/coverflow" android:layout_width="fill_parent"
    android:layout_height="wrap_content" android:layout_marginTop="5dip">
</view>

<pl.polidea.coverflow.CoverFlow xmlns:coverflow="http://schemas.android.com/apk/res/com.accessdev.myproject"
    coverflow:imageWidth="100dip" coverflow:imageHeight="150dip" coverflow:withReflection="true"
    coverflow:imageReflectionRatio="0.2" coverflow:reflectionGap="2dip" android:id="@+id/coverflowReflect"
    android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="5dip" />

<TextView android:text="STATUS" android:layout_width="fill_parent" android:layout_height="wrap_content"
    android:padding="5dip" android:id="@+id/statusText"></TextView>

第 7 行是引用了 coverflow 的第一行:

有什么建议么?

4

1 回答 1

2

似乎您需要使用pl.polidea.coverflow.CoverFlow而不是view在您的 xml 中,例如:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="fill_parent">



<pl.polidea.coverflow.CoverFlow class="pl.polidea.coverflow.CoverFlow" xmlns:coverflow="http://schemas.android.com/apk/res/com.accessdev.myproject"
    coverflow:imageWidth="100dip" coverflow:imageHeight="150dip" android:id="@+id/coverflow" android:layout_width="fill_parent"
    android:layout_height="wrap_content" android:layout_marginTop="5dip">
</pl.polidea.coverflow.CoverFlow >

<pl.polidea.coverflow.CoverFlow xmlns:coverflow="http://schemas.android.com/apk/res/com.accessdev.myproject"
    coverflow:imageWidth="100dip" coverflow:imageHeight="150dip" coverflow:withReflection="true"
    coverflow:imageReflectionRatio="0.2" coverflow:reflectionGap="2dip" android:id="@+id/coverflowReflect"
    android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="5dip" />

<TextView android:text="STATUS" android:layout_width="fill_parent" android:layout_height="wrap_content"
    android:padding="5dip" android:id="@+id/statusText"></TextView>

</LinearLayout>
于 2012-06-18T13:43:45.340 回答