想在Android的21英寸的屏幕布局提供 [英] Want to Provide layout for 21 inch screen in android

查看:102
本文介绍了想在Android的21英寸的屏幕布局提供的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想要一个布局文件夹21英寸screen.I有7英寸的平板电脑和sw720dp布局文件夹sw600dp 10英寸tablet.how我在android系统指定惠普Slate 21英寸平板电脑的文件夹?在此先感谢

I just want a layout folder for 21 inch screen.I have sw600dp for 7 inch tablet and sw720dp layout folder for 10 inch tablet.how i specify folder for hp slate 21 inch tablet in android?thanks in advance

推荐答案

只需添加低于code在某处你的活动,并在该设备上运行的应用程序,你会得到smallestWidthDp的价值。
如果你得到它800那么假设你需要创建一个名为布局文件夹布局sw800dp

Just add the below code in somewhere your Activity and run the application in that device, you will get the value of smallestWidthDp. suppose if you get it 800 then you need to create layout folder named layout-sw800dp

Configuration mConfig = this.getResources().getConfiguration();
if (Build.VERSION.SDK_INT >= 13) {
        int smallest_width_dp_value = mConfig.smallestScreenWidthDp;
                    Log.e("smallestWidthDp",smallest_width_dp_value+"");
    }

这篇关于想在Android的21英寸的屏幕布局提供的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆