gpt4 book ai didi

android - 无法在 Android 7.0 上将高分辨率图像 (1920x1280) 设置为 ImageView

转载 作者:行者123 更新时间:2023-12-02 01:46:45 25 4
gpt4 key购买 nike

我在很多设备上运行这个应用程序。低于 android 7 和高于 android 7 都可以。但是当我在三星 s6(android 7.0)上运行这个应用程序时,它给出了这个错误

Fatal Exception: java.lang.RuntimeException: Canvas: trying to draw too large(120422400bytes) bitmap. at android.view.DisplayListCanvas.throwIfCannotDraw(DisplayListCanvas.java:260) at android.graphics.Canvas.drawBitmap(Canvas.java:1420) at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:545) at android.view.View.getDrawableRenderNode(View.java:18591) at android.view.View.drawBackground(View.java:18527) at android.view.View.draw(View.java:18315) at android.view.View.updateDisplayListIfDirty(View.java:17302) at android.view.View.draw(View.java:18086) at android.view.ViewGroup.drawChild(ViewGroup.java:3966) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3752) at android.view.View.updateDisplayListIfDirty(View.java:17297) at android.view.View.draw(View.java:18086) at android.view.ViewGroup.drawChild(ViewGroup.java:3966) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3752) at android.view.View.updateDisplayListIfDirty(View.java:17297) at android.view.View.draw(View.java:18086) at android.view.ViewGroup.drawChild(ViewGroup.java:3966) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3752) at android.view.View.updateDisplayListIfDirty(View.java:17297) at android.view.View.draw(View.java:18086) at android.view.ViewGroup.drawChild(ViewGroup.java:3966) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3752) at android.view.View.updateDisplayListIfDirty(View.java:17297) at android.view.View.draw(View.java:18086) at android.view.ViewGroup.drawChild(ViewGroup.java:3966) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3752) at android.view.View.updateDisplayListIfDirty(View.java:17297) at android.view.View.draw(View.java:18086) at android.view.ViewGroup.drawChild(ViewGroup.java:3966) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3752) at android.view.View.draw(View.java:18327) at com.android.internal.policy.DecorView.draw(DecorView.java:919) at android.view.View.updateDisplayListIfDirty(View.java:17302) at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:692) at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:698) at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:806) at android.view.ViewRootImpl.draw(ViewRootImpl.java:3135) at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2931) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2523) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1522) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7098) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:927) at android.view.Choreographer.doCallbacks(Choreographer.java:702) at android.view.Choreographer.doFrame(Choreographer.java:638) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:913) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6682) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)

最佳答案

将(高分辨率)drawable 中的图像移动到 list 文件中的drawable-xxhdpi 和largeheap=true。

关于android - 无法在 Android 7.0 上将高分辨率图像 (1920x1280) 设置为 ImageView ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47279266/

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