我的主程序是在
package com.example.myapplication;
下写的,然后引入了一个
package com.uuzuche.lib_zxing.activity;
这个包。在这个新包下的所有R均报错Cannot resolve symbol 'R,例如:
setContentView(R.layout.camera);
但是我在项目里是有camera这个文件的,camera.xml内容如下:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#00B8EB"
android:orientation="horizontal">
<ImageButton
android:id="@+id/imageButton3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:contentDescription="@string/empty"
android:padding="0dp"
android:paddingStart="0dp"
android:paddingLeft="0dp"
android:paddingTop="0dp"
android:paddingEnd="0dp"
android:paddingRight="0dp"
android:paddingBottom="0dp"
android:scaleType="centerCrop"
android:scaleX="0.7"
android:scaleY="0.7"
app:srcCompat="@drawable/fanhui" />
<View
android:id="@+id/view"
android:layout_width="10dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView
android:id="@+id/textView2"
android:layout_width="150dp"
android:layout_height="50dp"
android:layout_weight="1"
android:gravity="center|start"
android:text="@string/erweima"
android:textColor="#ffffff"
android:textSize="20sp" />
</LinearLayout>
<FrameLayout
android:id="@+id/fl_zxing_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
</FrameLayout>
</LinearLayout>
这个文件也只有2k,也不存在网上说的过大问题,请问各位这是什么回事呢