处理所有屏幕尺寸的android [英] Handling all screen sizes android

查看:106
本文介绍了处理所有屏幕尺寸的android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用android应用程序,并且它是用数字(边距等)设计的,没有相关内容,所以我认为我会在屏幕尺寸不同的情况下发现很多问题,因此我想到了制作一个将数据保留在其中的功能 DIMENSIONS 文件与用户屏幕尺寸成正比,例如(用户的屏幕尺寸X dimen)/(设计应用程序的屏幕尺寸),所以我想知道这是否不会对App的工作造成任何问题等。

I'm working on an android App,and it's designed with numbers (margins etc) no relative things so I think I'll find many problems with different screen sizes so I thought of making a function which will keep the data in DIMENSIONS file proportional to user screen size like ( User's screen size X dimen)/(the screen size which the app were designed on), so I want to know if this won't cause any problem on App working etc ..

谢谢=)

推荐答案

也许您可以尝试在下面的库中自动管理所有屏幕尺寸分辨率。

May be you can try below library which manages all the screen size resolution automatically.

编译'com.intuit.sdp:sdp-android:1.0.4'

您只需要在 build.gradle 文件中添加依赖项即可。

You need to just add the dependency in your build.gradle file and you are done.

您需要指定以下内容:

android:layout_height = @ dimen / _10sdp

而不是:

android: layout_height = @ dimen / 10sdp

这篇关于处理所有屏幕尺寸的android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆