简体   繁体   English

在平板和手机上运行 AppAndroid 支持多屏

[英]Run AppAndroid on tablet and mobile phone support multi screen

i need that my app Android will be supported by 2 devices phone and tablet.我需要我的应用程序 Android 将被 2 台设备手机和平板电脑支持。

i can find library to integer in my app and supported all screen size.我可以在我的应用程序中找到 integer 的库并支持所有屏幕尺寸。

Thanks谢谢

I am assuming you want to support multiple screen sizes for your app.我假设您想为您的应用程序支持多种屏幕尺寸。 You can refer to this guide from Android Developers.您可以参考 Android Developers 的 指南。 Tl;dr you should make your layouts as flexible as possible. Tl;博士你应该使你的布局尽可能灵活。 That includes but not limited to这包括但不限于

  1. Use ConstraintLayout to define the percentage of screen covered by a component, ratio of sizes etc etc使用 ConstraintLayout 定义组件覆盖的屏幕百分比、大小比例等
  2. Avoid using hardcoded values(like layout_width="100dp" etc)避免使用硬编码值(如 layout_width="100dp" 等)

Also for a tablet, you must design an alternative layout which can take advantage of the larger screen in landscape mode同样对于平板电脑,您必须设计一种替代布局,以在横向模式下利用更大的屏幕

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM