开发者

Android orientation basic question

I am new to android programming. I have a background in my layout file and some image buttons on top. When the orientation of the phone is changed, I dont want the background to change orientation, but I want the image buttons to rotate appropriately. What is the best way to get this functionality?

Also I want to know the re开发者_如何学JAVAsolution of the images for the background for hdpi, mdpi and ldpi. Does it matter if I keep the same pixel size for each of them?


You can read about rotation here: http://developer.android.com/resources/articles/faster-screen-orientation-change.html

There is variety of different resolution for hdpi, mdpi and ldpi. http://developer.android.com/resources/dashboard/screens.html - here you can see what sizes and densities are the most popular. However, you can create layout specially for resolution you need (i.e. several layout for hdpi devices with different resolutions). The most popular resolutions are 320x480, 800x480, 854x480 (often I use the same layout as for 800x480).

You can read about supporting multiple screens here: http://developer.android.com/guide/practices/screens_support.html


No it doesn't matter I think, but can be there some resolution changes, like pixeled parts. I think that the best way to do it, if you make a land suffixed map for your layouts and drawables like: layout-land

Hope it helps!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜