当前位置: 首页 > 知识库问答 >
问题:

位图太大

颛孙麻雀
2023-03-14
 W/OpenGLRenderer﹕ Bitmap too large to be uploaded into a texture (3240x5760, max=4096x4096)
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent"
tools:context="${relativePackage}.${activityClass}"
android:background="@drawable/bg">

<EditText android:id="@+id/username_textfield"
          android:layout_width="270dp"
          android:layout_height="40dp"
          android:hint="Username"
          android:textColorHint="#ffffff"
          android:textColor="#ffffff"
          android:ellipsize="start"
          android:gravity="center_horizontal"
          android:singleLine="true"
          android:layout_marginTop="50dp"
          android:layout_marginLeft="60dp"
          android:background="@drawable/textfield_bg"/>

<EditText android:id="@+id/password_textfield"
          android:layout_width="270dp"
          android:layout_height="40dp"
          android:hint="Password"
          android:textColorHint="#ffffff"
          android:textColor="#ffffff"
          android:ellipsize="start"
          android:gravity="center_horizontal"
          android:singleLine="true"
          android:layout_marginTop="10dp"
          android:layout_marginLeft="60dp"
          android:background="@drawable/textfield_bg"/>

除了oncreate之外,我的MainActivity是空的。我已经阅读了关于这个问题的其他帖子,但没有一个为我提供任何真正的解决方案。

共有1个答案

胡和煦
2023-03-14

您应该创建可抽屉文件夹名称NODPI。nodpi apks可以与所有手机一起工作。

res/drawable-nodpi/中的drawable对任何屏幕密度都有效。如果在特定密度的目录中有另一个具有相同基名的drawable,并且运行应用程序的设备恰好具有该屏幕密度,则将使用特定密度的资源。因此,-NODPI成为一个备用方案,用于没有特定密度的情况下。

阅读CommonsBlog

 类似资料:
  • 我正在运行Ubuntu 16.04。在Android Studio上,当我试图在模拟器中运行我的应用程序时,我得到以下错误: 致命的例外:主要过程:项目名称在这里,PID: 2528java.lang.运行时间例外:画布:试图绘制太大(216090000bytes)位图。在android.view.DisplayListCanvas.throw如果不能绘制(DisplayListCanvas.ja

  • 我做了一个有很大背景的应用程序。它在Nexus7上运行得很好,但在我的Galaxy Nexus上,背景消失了,在logcat中给出了一个错误:位图太大,无法上传到纹理中(...)。 谢谢你提前帮我!

  • 我一直试图在Dataflow上运行一个apache beam作业,但我从GCP得到了一个错误,其中包含以下消息: 我在过去运行过带有较大图形的作业,没有任何问题。该作业在本地使用Directrunner也运行良好。图中大约有12个节点,包括一个read from Bigquery步骤、一个步骤和一个步骤。 有没有一种方法可以增加数据流愿意接受的图形大小?

  • 我收到了来自tesseract的5 MB大小图像的以下错误。 Tesseract开源OCR引擎v3.01与Leptonica第0页图像太大:(39667,56133)处理过程中出现错误。 文件大小是否有限制,或者是否有解决此问题的参数。 感谢您的帮助。

  • 我有一个发布的应用程序在Android N上启动时崩溃,因为新引入的

  • 我一直在谷歌上寻找问题的解决方案。我的启动器图标很小。我有启动器图标,原来是1100x1100,但我已经使用这个在线工具创建了正确的大小http://romannurik.github.io/AndroidAssetStudio/ 然后,我已经将png复制到正确的res文件夹中,但图标仍然很小 我使用的是android galaxy 3(9305) 我能告诉你如何强制应用程序选择另一个启动器吗 ?