Android fitsSystemWindows

public interface IWindowInsetLayout {
    boolean applySystemWindowInsets19(Rect insets);

    boolean applySystemWindowInsets21(WindowInsetsCompat insets);
}

1、在API 21以前,自定义Layout等布局重写View.fitSystemWindows调用接口api的实现

2、ViewCompat.setOnApplyWindowInsetsListener(view, insetsListener),在listener回掉里面做applySystemWindowInsets设置

令人困惑的fitsSystemWindows属性

Android使用fitsSystemWindows属性实现–状态栏【status_bar】各版本适配方案

猜你喜欢

转载自blog.csdn.net/heng615975867/article/details/82112845