安卓界面插入背景图片,当图片内存太大时,界面在切换时会加载失败,这是什么原因呢?这是设置android:background属性时发出的warning:

 Possible overdraw: Root element paints background @drawable/happy with a theme that also paints a background (inferred theme is @style/AppTheme)

分析:安卓模拟器运行内存较小,如果页面加载的图片内存过大,切换页面时,原页面并没有关闭,而是以缓存的形式存在后台,等待用户随时唤醒,本页面加上要跳转的页面需要
占用的运行内存资源已经超过了模拟器的运行内存,就会提示页面加载失败。

解决方法: 1.将需要显示的图片处理下,使其分辨率降低
2.更换运行内存更大的模拟器或者安卓手机
3.想办法在页面切换的同时结束掉之前页面的进程

Possible overdraw: Root element paints background @drawable/happy with a theme that also paints a background (inferred theme is @style/AppTheme)的更多相关文章

  1. AngularJS: 'Template for directive must have exactly one root element' when using 'th' tag in directive template

    .controller('HomeController', function($scope,$location) { $scope.userName='天下大势,为我所控!'; $scope.clkU ...

  2. android:background="@drawable/home_tab_bg"

    android:background="@drawable/home_tab_bg" home_tab_bg/xml: <bitmap xmlns:android=" ...

  3. Caused by: org.xml.sax.SAXParseException; systemId: file:/home/hadoop/hive-0.12.0/conf/hive-site.xml; lineNumber: 5; columnNumber: 2; The markup in the document following the root element must be well

    1:Hive安装的过程(Hive启动的时候报的错误),贴一下错误,和为什么错,以及解决方法: [root@master bin]# ./hive // :: INFO Configuration.de ...

  4. VUE之命令行报错:Component template should contain exactly one root element. If you are using v-if on multiple elements, use v-else-if to chain them instead 解决办法

    Failed to compile. ./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-5992 ...

  5. which had no Root Element. This likely means the XML is malformed or missing

    今天按照古月老师的步骤,想在RViz中配置插件. 按步骤做下来后,一运行,出现如下错误: [E[ERROR] [1523370744.057263390]: Skipping XML Document ...

  6. VUE编译报错 Component template should contain exactly one root element. If you are using v-if on multiple elements, use v-else-if to chain them instead

    背景: 在使用VUE添加标签的时候编译报错,报错如下: Component template should contain exactly one root element. If you are u ...

  7. vue报错:Component template should contain exactly one root element. If you are using v-if on multiple elements, use v-else-if to chain them instead.

    在.vue文件中引入了 element-ui 的 table 和 pagination 组件后,报错:Component template should contain exactly one roo ...

  8. maven web项目的web.xml报错The markup in the document following the root element must be well-formed.

    maven项目里面的web.xml开头约束是这样的 <?xml version="1.0" encoding="UTF-8"?> <web-a ...

  9. Document root element "configuration", must match DOCTYPE root "mapper".

    最近剛剛鼓搗mybatis , 第一個demo就出了問題.其實原因是因為將mapper中的頭copy到了configuration里去了 <?xml version="1.0" ...

随机推荐

  1. Python记通用列表操作之切片!

    ______________________________________除使用索引(indexing)来访问单个元素外,还可使用切片 (slicing) 来访问特定范围内的元素. 切片适用于提取序 ...

  2. django入门(二)MTV开发模式

    MTV开发模式,顾名思义,M是models,T是templates,V是view. 之前的教程没有牵扯到html,然后今天将告诉你如何转到自己做的静态页面 首先还是先创建一个app,python ma ...

  3. RESTful api设计风格

    简介 REST(Representational State Transfer):表象层状态转变   RESTful对api进行规范和约束,使得api统一规范,增强api的可读性,便于开发.   设计 ...

  4. 普及C组第四题(8.2)

    1342. [南海2009初中]cowtract(网络) (Standard IO) 题目:  Bessie受雇来到John的农场帮他们建立internet网络.农场有 N (2<= N < ...

  5. MNIST 数据集

    mnist 数据集:包含 7 万张黑底白字手写数字图片,其中 55000 张为训练集,5000 张为验证集,10000 张为测试集.每张图片大小为 28*28 像素,图片中纯黑色像素值为 0,纯白色像 ...

  6. python面向对象封装案例2

    封装 封装 是面向对象编程的一大特点 面向对象编程的 第一步 —— 将 属性 和 方法 封装 到一个抽象的 类 中 外界 使用 类 创建 对象,然后 让对象调用方法 对象方法的细节 都被 封装 在 类 ...

  7. C语言中二维数组如何申请动态分配内存

    C语言中二维数组如何申请动态分配内存: 使用malloc函数,先分配第一维的大小,然后再循环分配每一维的大小 #include <stdio.h> #include <malloc. ...

  8. 三大查找算法(Java实现)

    三大查找算法 1.二分查找(Binary Search) public class BinarySearch { public static void main(String[] args) { in ...

  9. Java开发简单的家居购物商城系统 JSP 附源码

    开发环境:    Windows操作系统开发工具: MyEclipse+Jdk+Tomcat+MYSQL数据库 注意:使用tomcat7运行 运行效果图 源码及原文链接:https://javadao ...

  10. IdentityHashCodeTest

    Java学习:identityHashCode和hashCode方法, System类提供了一个identityHashCode(Object x)方法,这个方法返回的是指定对象的精确hashCode ...