gpt4 book ai didi

java - android studio图形编辑器不显示布局图片

转载 作者:行者123 更新时间:2023-11-29 02:31:41 26 4
gpt4 key购买 nike

出于某种原因,我在 Android Studio 中处理的项目中,XML 图形编辑器已停止向我显示屏幕布局图片。该应用程序本身运行良好,布局在我的设备上运行良好,但我在编辑器中的计算机屏幕上没有它的图片。

编辑器显示错误渲染问题 - 渲染期间引发异常
在详细信息中,它向我显示了 java.lang.NullPointerException 的堆栈跟踪,它的提示是尝试刷新布局,但这不起作用。我尝试刷新、重建以及所有可能的其他刷新方式,但都无济于事。我检查了我从事过的其他项目,以及图形还不错的地方,但不是我当前的项目。所以我需要帮助找到问题。

java.lang.NullPointerException
at android.graphics.BidiRenderer.getScriptFont(BidiRenderer.java:290)
at android.graphics.BidiRenderer.getScriptRuns(BidiRenderer.java:280)
at android.graphics.BidiRenderer.renderText(BidiRenderer.java:133)
at android.graphics.BidiRenderer.renderText(BidiRenderer.java:108)
at android.graphics.Paint_Delegate.measureText(Paint_Delegate.java:1310)
at android.graphics.Paint_Delegate.nGetTextAdvances(Paint_Delegate.java:972)
at android.graphics.Paint_Delegate.nGetRunAdvance(Paint_Delegate.java:1147)
at android.graphics.Paint.nGetRunAdvance(Paint.java)
at android.graphics.Paint.getRunAdvance(Paint.java:2729)
at android.text.TextLine.getRunAdvance(TextLine.java:729)
at android.text.TextLine.handleText(TextLine.java:778)
at android.text.TextLine.handleRun(TextLine.java:1018)
at android.text.TextLine.measureRun(TextLine.java:417)
at android.text.TextLine.measure(TextLine.java:310)
at android.text.TextLine.metrics(TextLine.java:281)
at android.text.Layout.measurePara(Layout.java:1966)
at android.text.Layout.getDesiredWidthWithLimit(Layout.java:186)
at android.widget.TextView.onMeasure(TextView.java:8168)
at android.view.View.measure(View.java:22035)
at android.widget.Toolbar.measureChildCollapseMargins(Toolbar.java:1548)
at android.widget.Toolbar.onMeasure(Toolbar.java:1662)
at android.view.View.measure(View.java:22035)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6622)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
at com.android.internal.widget.ActionBarContainer.onMeasure(ActionBarContainer.java:291)
at android.view.View.measure(View.java:22035)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6622)
at com.android.internal.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java:378)
at android.view.View.measure(View.java:22035)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461)
at android.view.View.measure(View.java:22035)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.measureView(RenderSessionImpl.java:590)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:343)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:384)
at com.android.tools.idea.layoutlib.LayoutLibrary.createSession(LayoutLibrary.java:193)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:547)
at com.android.tools.idea.rendering.RenderTask.lambda$inflate$3(RenderTask.java:681)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

最佳答案

在 xml 工具栏中,您可以找到刷新按钮,这样它会通知您的 xml 中是否有任何警告。如果您使用了自定义布局,则会显示渲染问题。

关于java - android studio图形编辑器不显示布局图片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49355470/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com