gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 07:44:28 24 4
gpt4 key购买 nike

我尝试在我自己的 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com