在android中的相机预览上重叠其他视图
我正在遵循Android开发者指南中的摄像头API(现在使用v1)。我找不到重叠视图的方法(在我的例子中是预览顶部的imagebutton/imageview)。我使用的是框架布局。这是布局代码在android中的相机预览上重叠其他视图,android,android-camera,Android,Android Camera,我正在遵循Android开发者指南中的摄像头API(现在使用v1)。我找不到重叠视图的方法(在我的例子中是预览顶部的imagebutton/imageview)。我使用的是框架布局。这是布局代码 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schem
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.blackfruit.camfilters.CameraActivity"
android:orientation="vertical"
>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/cameraPreview"
android:layout_weight="1">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageView"
android:src="@drawable/snap"
android:layout_gravity="bottom|center"
android:layout_marginBottom="20dp"
/>
</FrameLayout>
</RelativeLayout>
我知道还有其他方法,例如使用surfaceview和linearlayout。但我发现了这个方法的问题。我见过有人说这完全有效,但我的意思不是说我只看到相机预览,没有任何按钮或图像重叠。
有人能帮我吗?反复试验。我设法解决了这个问题。我使用了
myImageView.bringToFront()代码>
这最终解决了问题。请详细解释“我的不”的含义。抱歉补充道。要清楚,我看到的只是预览,而不是覆盖它的imageview。