开发者

Android Dev: max screen length

I am creating an application for android OS. The problem im facing is that running the application on different devices with different resolutions, the layout eitehr become too small, on hi res screens, or too chunky on low res screens. H开发者_运维知识库ow do i make it so that my layouts adapt to the screen on the device?? Do i use relative layout Or is there a way i can just find out the max screen length and width...?


Use RelativeLayout -- thats the best option.

In anycase, if you want to find out the max dimensions:

private void setupGlobal() {

        Display display = getWindowManager().getDefaultDisplay();

        int width = display.getWidth();
        int height = display.getHeight();

        Global.screenHeight = height;
        Global.screenWidth = width;

    }
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜