项目使用3D检查UI布局渲染


在配置文件导入第三方库


compile 'com.jakewharton.scalpel:scalpel:1.1.2'


configs 配置是否开启该功能


具体的父类activity实现方法

public class BaseActivity extends FragmentActivity {

    private static final String TAG = BaseActivity.class.getSimpleName();

    @Override
    public void setContentView(int layoutResID) {
        if(Configs.TEST_UI){
            View mainView = getLayoutInflater().inflate(layoutResID,null);
            ScalpelFrameLayout scalpelFrameLayout = new ScalpelFrameLayout(this);
            scalpelFrameLayout.addView(mainView);
            scalpelFrameLayout.setLayerInteractionEnabled(true);
            scalpelFrameLayout.setDrawIds(true);
            super.setContentView(scalpelFrameLayout);
        }else {
            super.setContentView(layoutResID);
        }
    }

相关文章:

  • 2022-02-25
  • 2022-12-23
  • 2022-12-23
  • 2022-01-07
  • 2021-08-24
  • 2021-05-17
  • 2021-12-22
猜你喜欢
  • 2021-10-26
  • 2022-01-13
  • 2021-10-08
  • 2021-11-06
  • 2021-05-18
  • 2021-09-22
  • 2021-11-14
相关资源
相似解决方案