@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的實現(xiàn)原理分析在Android系統(tǒng)中疯坤,有一種特殊的視圖滩援,稱為SurfaceView,它擁有獨立的繪圖表面蛮粮,即它不與其宿主窗口共享同一個繪圖表面。由于擁有獨立的繪圖表面,因此SurfaceV...