简体   繁体   English

如何在较小的手机中解决我的应用程序出现的剪切问题?

[英]How do I get around clipping issues with my app in smaller phones?

I have a basic linear layout, with image view that display photos, textviews that show text etc...and when I test my whole app on my android 2, there is never any part of the screen that doesn't show. 我有一个基本的线性布局,带有显示照片的图像视图,显示文本的textview等...,当我在android 2上测试整个应用程序时,屏幕的任何部分都不会显示。 But when I test it in the QVGA emulator, half the view is off the screen. 但是,当我在QVGA仿真器中对其进行测试时,一半的视图不在屏幕上。 Now, some of my text is defined to a certain size. 现在,我的一些文本被定义为一定的大小。

I never use px (only dip) in any of my xml. 我从不在任何xml中使用px(仅蘸)。 I use fill_parent, wrap_content where it is needed and never fix a height or length. 我在需要的地方使用fill_parent,wrap_content,并且从不固定高度或长度。 Could it be with my text, I use say, textSize = 22dip? 我用的是textSize = 22dip吗? I couldn't find documentation on why that would not work in all sizes. 我找不到有关为何无法在所有尺寸上使用的文档。

Could it be that some apps need to be programmed to those screen sizes? 是否可能需要将某些应用程序编程为这些屏幕尺寸? Or am I missing something? 还是我错过了什么?

Thanks! 谢谢!

DIP actually doesn't help in fluid layout design. DIP实际上对流体布局设计没有帮助。 DIP tries to make sure things will looks the same size across different screen density. DIP试图确保在不同的屏幕密度下,事物的尺寸看起来相同。 (imagine the concept of Point in typography) (想象一下排版中“点”的概念)

Without your code and/or screenshot of what happen, it is hard to judge what happens to your program, but 22dip text size is possibly one of the reason which: 没有代码和/或屏幕快照,很难判断程序会发生什么,但是22dip文本大小可能是以下原因之一:

  1. 22dip text in HDPI will become: 22 * 240 / 160 = 33 pixel HDPI中的22dip文本将变为:22 * 240/160 = 33像素
  2. 22dip text in LDPI will become: 22 * 120 / 160 = 16.5 pixel LDPI中的22dip文本将变为:22 * 120/160 = 16.5像素

If your setting on QVGA is HDPI, then it is actually 33 pixel tall for a letter, which consumes more than 1/10 of the screen height. 如果您在QVGA上的设置为HDPI,则实际上一个字母的高度为33像素,这消耗了超过屏幕高度的1/10。

By the way, your 16:9 wide screen (vertical) may fit everything in one screen without scroll, while QVGA is only 3:2 screen, even though everything is in proportion, something would be hidden away for sure. 顺便说一句,您的16:9宽屏(垂直)可以在一个屏幕中无滚动显示地容纳所有内容,而QVGA仅为3:2屏幕,即使所有内容都按比例放置,也肯定会隐藏一些东西。

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

相关问题 为什么我的应用在高分辨率Android手机上看起来更小? - Why does my app look smaller on High Resolution Android phones? 如何防止在手机中安装Android应用程序? - How I can prevent installation of my android app in phones? 如何让我的 AlarmManager 在所有手机上工作 && 我如何获得许可来安排我的闹钟而不删除它们 - how to make my AlarmManager work on all phones && How do I get permission to schedule my alarms without ever deleting them 使用3G时如何在手机上绕过NAT? - How to get around NAT on mobile phones while using 3G? 当我的TextViews周围有曲线时,如何摆脱ExpandableListView中的子分隔线 - How do I get rid of the child divider in an ExpandableListView when I have curves around my TextViews 如何使 Android Flutter 应用程序图标变小? - How do I make the Android Flutter app icon smaller? 如何将视图布局参数宽度设置得更小? - How Do I Set My View LayoutParams Width Smaller? 如何缩小我的Android按钮? - How do I make my Android button smaller? 如何将我的 android 工作室项目设置为我的手机背景? - How do I set my android studio project as my phones background? 如何在Android手机上访问相机? - How do I access the camera on Android phones?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM