1.Android Studio多分辨率圖片導(dǎo)入
Android Studio使用一張圖片生成各個分辨率相應(yīng)的圖片
按這里的操作津畸,然后選中圖片生成就可以了。
2.realm的一個坑
Couldn’t load “l(fā)ibrealm-jni.so”
If your app uses other native libraries that don’t ship with support for 64-bit architectures, Android will fail to load Realm’s librealm-jni.so file on ARM64 devices. This is because Android cannot load 32-bit and 64-bit native libraries concurrently. The best solution would be to have all libraries provide the same set of supported ABIs, but sometimes that may not be doable if you are using a 3rd-party library. See VLC and Realm Library conflicts.
The workaround to this issue is to exclude Realm’s ARM64 library from the APK file by adding the following code to the app’s build.gradle. You can refer to Mixing 32- and 64-bit Dependencies in Android for more information.
概括來說跟jni有關(guān)必怜,如果一個app指定了只使用32位架構(gòu)肉拓,且引用了不止一個.so文件,so文件里又有的是64位有的是32位的話梳庆,就會出現(xiàn)這個問題暖途。realm官方提供了一個解決辦法卑惜,但是感覺不是很好,所以realm暫時不會去用了驻售。
android {
//...
packagingOptions {
exclude "lib/arm64-v8a/librealm-jni.so"
}
//...
}
3.關(guān)于ViewStub
ViewStub是拿來注入的露久,不是拿來替換的。