简体   繁体   English

模拟器与设备上的 Android 布局

[英]Android layout on emulator vs device

I've created my app using all the neccessary things to support different screen sizes/densities (relative layouts, dip etc.)我已经使用所有必要的东西创建了我的应用程序来支持不同的屏幕尺寸/密度(相对布局、倾角等)

I've created all the neccessary layout files (ldpi,mdpi etc) and images for this support.我已经为此支持创建了所有必要的布局文件(ldpi、mdpi 等)和图像。

I've tested the app on all the available emulator skins using Eclipse, and they all appear like the should.我已经使用 Eclipse 在所有可用的模拟器皮肤上测试了该应用程序,它们看起来都应该如此。 I then tested this on a real device (Samsung Galaxy SII) and it looked great.然后我在真实设备(Samsung Galaxy SII)上测试了它,它看起来很棒。 Then I tested it on a Galaxy Tab (7") and the layouts were a bit wrong, and the text sizes were wrong too, making it look really bad on the tablet.然后我在 Galaxy Tab (7") 上测试了它,布局有点不对,文字大小也不对,让它在平板电脑上看起来很糟糕。

I'm really confused by this, because it was tested using all of the emulator skins (this includes a 7" screen skin). I then created a custom AVD - (1024X600, 240 density), to match the exact specs of the galaxy tablet. This again looked as it should on the emulator, but the real device shows differently.我真的对此感到困惑,因为它是使用所有模拟器皮肤(包括 7" 屏幕皮肤)进行测试的。然后我创建了一个自定义 AVD -(1024X600,240 密度),以匹配银河系的确切规格平板电脑。这再次在模拟器上看起来应该如此,但真实设备显示不同。

Any thoughts why this is?任何想法这是为什么? Shouldn't an emulator with the same specs of a real device look the same as the device?与真实设备具有相同规格的模拟器不应该看起来与设备相同吗?

Thanks谢谢

Take a look at this post:看看这篇文章:

Android, concerning the User Interface design Android,关于用户界面设计

You will note a comment from Tim where he mentions that the Galaxy Tab 7" has a large screen and uses the mdpi resources. So your emulator is setup for 1024x600 with hdpi, which would explain the difference.你会注意到 Tim 的评论,他提到 Galaxy Tab 7" 有一个大屏幕并使用 mdpi 资源。所以你的模拟器设置为 1024x600 和 hdpi,这可以解释差异。

Or just download/install the emulator from Samsung.或者只是从三星下载/安装模拟器。

Emulate Samsung Galaxy Tab 模拟 Samsung Galaxy Tab

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

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