我的工作创造一个纸牌游戏为Android。我想拿出一个布局,使该游戏在所有屏幕大小和密度播放。
I am working on creating a card game for android. I am trying to come up with a layout that will allow the game to be played on all screen sizes and densities.
我已经阅读: http://developer.android.com/guide/practices/ screens_support.html
不过,我仍然感到困惑的做到这一点的最好办法。
However, I am still confused on the best way to do this.
对于这场比赛,我需要奠定了在横向模式下,在5列卡。上面有额外的卡5列的地方。它非常类似于在这方面,接龙......但我只有需要5列,而不是7。
For this game, I need the cards laid out in landscape mode, in 5 columns. There are places above the 5 columns for additional cards. It is very similar to solitaire in this respect...but I only have need for 5 columns instead of 7.
应该是在LDPI,MDPI和HDPI什么大小卡的图像?
What size card images should be in ldpi, mdpi, and hdpi?
我应该使用什么类型的布局(表,线性,相对)?
What type of layout should I use (Table, Linear, Relative)?
我应该创建不同的布局,为不同的屏幕尺寸(小,中,大)?
Should I create different layouts for the different screen sizes (small, normal, large)?
任何例子,你可以指向我?
Any examples you can point me to?
在Android文档中有关于这个问题的一个很大的指导:
The android documentation has a great guide on the subject:
支持多画面
他们介绍广义大小和密度,并显示资源多么的不同可以被动态地加载不同的屏幕。
They introduce generalized sizes and densities and show how different resources can be loaded dynamically for different screens.
我是新到Android自己,所以不要把我的话,但是,我认为你可以逃脱一种布局所有的屏幕尺寸,我认为RelativeLayout的将工作做好(在大多数情况下),特别的东西一样复杂的牌游戏。我主要使用LinearLayouts内RelativeLayouts当我想对齐按钮/文本水平。
I'm new to android myself, so don't take my word for it, but, I think you can get away with one layout for all screen sizes, and I think RelativeLayout will work well (in most cases), especially with something as complex as a card game. I've mainly used LinearLayouts inside RelativeLayouts when I've wanted to align buttons/text horizontally.
上一篇:从供应商目录为开源包做贡献?开源、做贡献、供应商、目录
下一篇:Composer [UnexpectedValueException] 错误将尝试使用 composer 安装一个 github 项目错误、项目、UnexpectedValueException、Co