【问题标题】:Android Add two surface view to single LayoutAndroid将两个表面视图添加到单个布局
【发布时间】:2011-05-13 06:24:47
【问题描述】:

我的问题可能很愚蠢。我发帖是想知道是否有可能在相对布局下添加两个表面视图对象。

我需要一个表面视图来流式传输视频,而另一个视图则执行精灵动画。

我尝试将它们放在相对布局下,但我首先放在布局上的表面视图优先,第二个视图消失了。

请给我一个解决方案。

编辑:

<RelativeLayout android:id="@+id/widget31"
android:orientation="vertical"
 android:layout_width="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="fill_parent">
   <LinearLayout android:layout_height="fill_parent" android:layout_width="fill_parent" android:id="@+id/widget30" android:orientation="vertical">

    </LinearLayout>
     <com.mycalss.CameraView
    android:id="@+id/camerapreview" android:clickable="true"
    android:layout_width="wrap_content" android:layout_height="wrap_content" 
    android:focusable="true"/>



</RelativeLayout>

现在我在代码中的 linearlayout-widget30 中添加图形的表面视图

【问题讨论】:

  • 你应该能够做你正在尝试的事情。你能发布你当前的布局文件吗?

标签: android surfaceview


【解决方案1】:

您的视图大小似乎不正确:尝试将两者的 layout_height 设置为 0dp,然后将两者的 layout_weight 设置为 1,看看它们是否都显示出来。

【讨论】:

    猜你喜欢
    • 2013-09-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多