【问题标题】:Remove Overlay Background in camera view在相机视图中删除叠加背景
【发布时间】:2016-10-03 10:39:32
【问题描述】:

我想做的是在surfaceview中创建一个相机预览并在上面添加按钮。

我正在获取相机预览,但不幸的是 Linearlayout 有一个难看的白色背景。

它怎么可能是透明的?

我什至尝试过#00ffffff,但没有成功

<FrameLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent">
    <SurfaceView android:id="@+id/surfaceView1" android:layout_width="wrap_content" android:layout_height="wrap_content"></SurfaceView>
    <LinearLayout android:id="@+id/linearLayout1" android:layout_width="wrap_content" android:layout_height="wrap_content">
        <Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
        <Button android:text="Button" android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
    </LinearLayout>
</FrameLayout>

【问题讨论】:

    标签: android layout android-camera android-linearlayout surfaceview


    【解决方案1】:

    对于按钮,您需要添加以下属性。

    android:background="@null"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-05-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多