[英]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文本大小可能是以下原因之一:
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.