java - Android coverflow : Error inflating class pl. poliea.coverflow.CoverFlow

标签 java android android-layout coverflow runtimeexception

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

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

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 的第一行:

有什么建议吗?

最佳答案

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

<?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>

关于java - Android coverflow : Error inflating class pl. poliea.coverflow.CoverFlow,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11084126/

相关文章:

Android设置字符编码

java - 如何使底部工作表对话框的角变圆?

android - 如何组合两个独立的android样式来创建一个新的

android - 在 Cordova/Phonegap CLI 项目中同步 www/目录的最佳方法是什么?

Java - 将对象存储在遵循其类继承的层次结构中

java - 从 Flex 调用 jar 文件命令

java - 使用 lambda 表达式不可能重复的功能接口(interface)解析

android - SMS 正文并未更改其 Intent 中的文本

android - CardView 未显示在 RecyclerView 中

java - 去除空白 ascii 字符