在针对android Kitkat的relativelayout中创建两个SurfaceView时出现问题
当我尝试在一个相对布局中创建两个SurfaceView时,一个用于本地预览帧,另一个用于remoteview,我无法看到本地预览帧。远程视图使用完整屏幕。它适用于jellybean及以下版本,但不适用于kitkat(我正在开发一个IP视频通话应用程序) 以下是我正在使用的代码片段:在针对android Kitkat的relativelayout中创建两个SurfaceView时出现问题,android,android-layout,surfaceview,Android,Android Layout,Surfaceview,当我尝试在一个相对布局中创建两个SurfaceView时,一个用于本地预览帧,另一个用于remoteview,我无法看到本地预览帧。远程视图使用完整屏幕。它适用于jellybean及以下版本,但不适用于kitkat(我正在开发一个IP视频通话应用程序) 以下是我正在使用的代码片段: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/root_lay
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/root_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFFFFF">
<SurfaceView
android:id="@+id/remote_surface"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:background="@drawable/layout_border"
/>
<SurfaceView
android:id="@+id/local_surface"
android:layout_height="180px"
android:layout_width="180px"
android:layout_marginBottom="-4dip"
android:layout_alignParentLeft="true"
android:layout_above="@+id/swap_camera"
android:background="@drawable/layout_border"
/>
</Relativelayout>
您已将远程\u曲面的宽度设置为填充父曲面
,因此它基本上覆盖了本地\u曲面
视图。将行android:layout\u置于=“@id/local\u surface”
上方。这应该可以工作。完成此操作后,远程屏幕表面没有覆盖整个屏幕,而是保留整个屏幕宽度,而不是本地屏幕表面的180像素