@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...