240 发简信
IP属地:贵州
  • @army魔君 我的布局是这样的 <FrameLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <SurfaceView
    android:id="@+id/scanner_view"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_gravity="center" />
    <com.citicbank.pos.google.zxing.view.ViewfinderView
    android:id="@+id/viewfinder_content"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:corner_color="@color/fw_key_done"
    app:frame_color="@color/viewfinder_frame"
    app:label_text="@string/scan_hint_text"
    app:mask_color="@color/viewfinder_mask"
    app:result_color="@color/result_view" />
    <FrameLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">
    <include
    android:id="@+id/header_layout"
    layout="@layout/common_app_header_layout" />
    <Button
    android:id="@+id/btn_code_input"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:layout_marginTop="30dp"
    android:background="@null"
    android:hint="@string/scan_edit_hint"
    android:textSize="@dimen/all_tenpay_main_second_title" />
    </LinearLayout>
    </FrameLayout>
    </FrameLayout>
    但是在父类加了 public void onAttachedToWindow() {
    this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
    }这个,然后子类重写父类的onAttachedToWindow()方法之后就只显示SurfaceView不显示我别的布局了

    Android视图SurfaceView的实现原理分析

    在Android系统中,有一种特殊的视图,称为SurfaceView,它拥有独立的绘图表面,即它不与其宿主窗口共享同一个绘图表面。由于拥有独立的绘图表面,因此SurfaceV...

  • 作者你好,我在BaseActivity的onAttachedToWindow()里面写了一个禁用HOME键的操作,在相机扫描CaptureActivity继承BaseActivity,导致布局只有SurfaceView而我的其他布局不显示,这个问题有解决的思路么?重写onAttachedToWindow()也不行。

    Android视图SurfaceView的实现原理分析

    在Android系统中,有一种特殊的视图,称为SurfaceView,它拥有独立的绘图表面,即它不与其宿主窗口共享同一个绘图表面。由于拥有独立的绘图表面,因此SurfaceV...

  • 120
    Android 和 Cordova 混合开发 以及自定义插件

    写在开始 : 主要介绍了在Android平台上使用Cordova 开发 JS/HTML 程序 , Cordova 提供了一些设备相关的API, 通过api 可以通过 js 调...

  • 120
    【Android】Service前台服务的使用

    1.什么是前台服务 前台服务是那些被认为用户知道(用户所认可的)且在系统内存不足的时候不允许系统杀死的服务。前台服务必须给状态栏提供一个通知,它被放到正在运行(Ongoing...