错嫁寡情总裁放开我,大学生情感问题,果照门
app\src\main\res\mipmap-hdpi,不要放进drawable文件夹)
xml version="1.0" encoding="utf-8"> <framelayout xmlns:android="https://schemas.android.com/apk/res/android" xmlns:app="https://schemas.android.com/apk/res-auto" xmlns:tools="https://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".framelayoutapp" imageview android:id="@+id/imageview" android:layout_width="wrap_content" android:layout_height="406dp" app:srccompat="@mipmap/photos" android:layout_gravity="center" imageview android:id="@+id/imageview2" android:layout_width="206dp" android:layout_height="179dp" android:layout_gravity="center" app:srccompat="@mipmap/pictures" /> framelayout>
方法二(将图片放入app\src\main\res\drawable时)
xml version="1.0" encoding="utf-8"> <framelayout xmlns:android="https://schemas.android.com/apk/res/android" xmlns:app="https://schemas.android.com/apk/res-auto" xmlns:tools="https://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".framelayoutapp" imageview android:id="@+id/imageview" android:layout_width="wrap_content" android:layout_height="406dp" app:srccompat="@drawable/photos" android:layout_gravity="center" imageview android:id="@+id/imageview2" android:layout_width="206dp" android:layout_height="179dp" android:layout_gravity="center" app:srccompat="@drawable/pictures" /> framelayout>
会出现内存溢出问题
关于java.lang.outofmemoryerror: failed to allocate a 127844364 byte allocation with 16768792 free bytes and 63mb until oom
在androidmanifest中的application加入以下代码:
android:hardwareaccelerated="false" android:largeheap="true" //申请更多的内存
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Android apk 项目一键打包并上传到蒲公英的实现方法
Android 自定义LineLayout实现满屏任意拖动功能的示例代码
android 限制某个操作每天只能操作指定的次数(示例代码详解)
Android 集成 google 登录并获取性别等隐私信息的实现代码
网友评论