gpt4 book ai didi

java - 安卓 OpenCV : No resource identifier found for attribute 'camera_id' in package

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:51:08 24 4
gpt4 key购买 nike

我在我的 Eclipse 中设置了 OpenCV 和 Android。以下是我的布局文件之一:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:opencv="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<org.opencv.android.JavaCameraView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:visibility="gone"
android:id="@+id/hello"
opencv:show_fps="true"
opencv:camera_id="any" />
</LinearLayout>

Eclipse 编译器提示:

No resource identifier found for attribute 'show_fps' in package 
No resource identifier found for attribute 'camera_id' in package

最佳答案

请在项目的值目录中添加以下资源文件:

attrs.xml

内容如下:

<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name = "CameraBridgeViewBase" >
<attr name="show_fps" format="boolean"/>
<attr name="camera_id" format="integer" >
<enum name="any" value="-1" />
<enum name="back" value="0" />
<enum name="front" value="1" />
</attr>
</declare-styleable>
</resources>

关于java - 安卓 OpenCV : No resource identifier found for attribute 'camera_id' in package,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18135391/

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