我有你在图片中看到的布局(抱歉我还不能正常发布它们): https ://dl.dropboxusercontent.com/u/28640502/Unbenannt.bmp
但是,当我执行应用程序时,我只能看到相机预览,而不是文本或 SeekBar。我知道它们可以工作,因为当我缩小相机尺寸时,我可以看到它们并进行交互,但如果我想让相机像背景一样,然后是孩子们在它上面,它就行不通了。
我一直在检查很多有类似问题的线程,但我没有找到解决方案: 1 , 2 , 3 ... 知道吗?非常感谢!
这是我的xml代码以防万一:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.55"
android:orientation="vertical" >
<FrameLayout
android:id="@+id/camera_preview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="fill">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="@+id/show_height"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5sp"
android:layout_marginRight="10sp"
android:layout_weight="0.12"
android:text="H" />
<SeekBar
android:id="@+id/select_height"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_margin="5sp"
android:layout_weight="0.91" />
<TextView
android:id="@+id/show_distance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.06"
android:text="Dist" />
</LinearLayout>
</FrameLayout>
</LinearLayout>