【发布时间】:2017-11-04 14:03:14
【问题描述】:
启动片段时出现短时间黑屏。我将对片段进行条形码扫描。
如果我只是打开一个空白屏幕,我看不到黑屏。我想我要打开的问题是片段加载时间长。
我该如何解决这个问题
我的代码
getFragmentManager().beginTransaction()
.replace(R.id.container,newFragment2())
.commit();
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.dlazaro66.qrcodereaderview.QRCodeReaderView
android:id="@+id/qrdecoderview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
/>
</LinearLayout>
【问题讨论】:
-
你设置了 Fragment 的布局吗?如果是,请在此处发布代码。那么只有有人可以提供帮助。
-
你的代码在哪里?没有代码,没有帮助
-
对不起。我添加了代码
标签: android android-layout android-fragments android-activity