android - 针对机型打补丁

访问量: 151

下面代码,是针对三星的长屏(s8)  打的补丁:

                LinearLayout step1 = (LinearLayout)rootView.findViewById(R.id.tab3_kyc_step1_instruction_page);
                FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);

                // 调整top margin
                if(Build.MODEL.equals("SM-G9500")){
                    lp.setMargins(0, (int)Utils.convertDpToPixel(-22f, getActivity()), 0, 0);
                    step1.setLayoutParams(lp);
                }

订阅/RSS Feed

Subscribe

分类/category