1.适配注意事项收集(笔记)

1.Android View未显示时获取其高度(https://blog.csdn.net/u010886975/article/details/53007490

public int[] unDisplayViewSize(View view) {
        int size[] = new int[2];
        int width = View.MeasureSpec.makeMeasureSpec(0,
                View.MeasureSpec.UNSPECIFIED);
        int height = View.MeasureSpec.makeMeasureSpec(0,
                View.MeasureSpec.UNSPECIFIED);
        view.measure(width, height);
        size[0] = view.getMeasuredWidth();
        size[1] = view.getMeasuredHeight();
        return size;
    }
--------------------- 
作者:云雾雨烟 
来源:CSDN 
原文:https://blog.csdn.net/u010886975/article/details/53007490 
版权声明:本文为博主原创文章,转载请附上博文链接!

2.判断手机是否显示虚拟按键(https://blog.csdn.net/xiaoyu940601/article/details/74606073

 public boolean isNavigationBarShow(){
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
            Display display = getActivity().getWindowManager().getDefaultDisplay();
            Point size = new Point();
            Point realSize = new Point();
            display.getSize(size);
            display.getRealSize(realSize);
            boolean  result  = realSize.y!=size.y;
            return realSize.y!=size.y;
        }else {
            boolean menu = ViewConfiguration.get(getActivity()).hasPermanentMenuKey();
            boolean back = KeyCharacterMap.deviceHasKey(KeyEvent.KEYCODE_BACK);
            if(menu || back) {
                return false;
            }else {
                return true;
            }
        }
    }

3.屏幕适配(https://blog.csdn.net/u013000152/article/details/80855315                      https://blog.csdn.net/qq_35195386/article/details/80801597    ( https://www.jianshu.com/p/4aa23d69d481  autosize)      )

4.干货集中营(沉浸式-https://github.com/dongjunkun/GanK

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值