【发布时间】:2015-01-27 13:58:07
【问题描述】:
我在 Google 中下载了一个 Android 应用程序。其中的某些布局可以在图形布局中查看,而其他布局则不能,例如此布局
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:camera="http://schemas.android.com/apk/res/com.android.camera"
android:background="@drawable/ic_launcher"
android:id="@+id/camera"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.android.camera.PreviewFrameLayout android:id="@+id/frame_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="2dp"
android:layout_weight="1">
<FrameLayout android:id="@+id/frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/ic_launcher">
<SurfaceView android:id="@+id/camera_preview"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<com.android.camera.FocusRectangle
android:id="@+id/focus_rectangle"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</FrameLayout>
</com.android.camera.PreviewFrameLayout>
我在下面得到了这些话:
渲染期间引发异常:com.android.layoutlib.bridge.MockView 无法转换为 android.view.ViewGroup 异常详细信息记录在窗口 > 显示视图 > 错误日志中 找不到以下类: - com.android.camera.PreviewFrameLayout(修复构建路径、编辑 XML、创建类)。
【问题讨论】: