Android使用refs.xml进行屏幕适配

本文探讨了在Android应用开发中,如何利用refs.xml进行屏幕适配。通过分析Master/Detail Flow模板的activity_item_list.xml文件,揭示了在不同屏幕尺寸设备上,如何通过refs.xml来实现大屏设备的分栏显示。重点关注了values-large和values-sw600dp目录下的refs.xml文件在控件布局中的作用。
摘要由CSDN通过智能技术生成

目前我们通过eclipse来new一个Android application时有好多模板(如下图所示)可以选择,以前没太注意,今天研究下.

当使用Master/Detail Flow模板时,发现运行的效果跟模板预览的效果不一致,从代码中发现

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_item_list);

        if (findViewById(R.id.item_detail_container) != null) {
            // The detail container view will be present only in the
            // large-screen layouts (res/values-large and
            // res/values-sw600dp). If this view is present, then the
            // activity should be in two-pane mode.
            mTwoPane = true;

            // In two-pane mode, list items should be given the
            // 'acti
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值