
例如,使用此代码:
<ImageVIEw androID:ID="@+ID/imageVIEw1" androID:layout_wIDth="match_parent" androID:layout_height="match_parent" androID:layout_margintop="32dp" androID:src="@mipmap/ic_login_logo" />
我确实得到了正确的密度但尺寸错误,如果我这样做:
<ImageVIEw androID:ID="@+ID/imageVIEw1" androID:layout_wIDth="150dp" androID:layout_height="150dp" androID:layout_margintop="32dp" androID:src="@mipmap/ic_login_logo" />
我得到了合适的尺寸……但密度不对.
我不是UI / UX专家,我之前没有使用drawables来解决这个问题.
我甚至无法从IDE中的drawable-xxx文件夹中添加我的资源:
这有解决方法吗?谢谢.
解决方法 我只是搜索mipmap文件夹的用法.根据 this answer&这 Google blogspot:It’s best practice to place your app icons in mipmap- folders (not the drawable- folders) because they are used at resolutions different from the device’s current density.
this answer也有参考文献的详细解释.
正如我从阅读这些答案中所理解的那样,我们将图标放在mipmap-xxx文件夹上,然后像以前一样将我们将在drawable-xxx文件夹上使用的drawable放入.
总结以上是内存溢出为你收集整理的Android mipmap,图像密度?全部内容,希望文章能够帮你解决Android mipmap,图像密度?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)