1、对应的application注册中:添加 android:theme="@style/Theme.AppCompat.NoActionBar"
android状态栏一体化(沉浸式状态栏)
https://blog.youkuaiyun.com/jdsjlzx/article/details/41643587
https://www.jianshu.com/p/0acc12c29c1b
开机界面,图片全屏加载
//得到当前界面的装饰视图 if(Build.VERSION.SDK_INT >= 21) { View decorView = getWindow().getDecorView(); //让应用主题内容占用系统状态栏的空间,注意:下面两个参数必须一起使用 stable 牢固的 int option = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN|View.SYSTEM_UI_FLAG_LAYOUT_STABLE; decorView.setSystemUiVisibility(option); //设置状态栏颜色为透明 getWindow().setStatusBarColor(Color.TRANSPARENT); } //隐藏标题栏 ActionBar actionBar = getSupportActionBar(); actionBar.hide();
java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
public Object instantiateItem(@NonNull ViewGroup container, int position) { int newPosition = position % 3; ImageView view = adImages.get(newPosition); container.addView(view); return view; }
============
//fix ->The specified child already has a parent. You must call removeView() on the child's parent first. if(view.getParent() != null) { ((ViewGroup)view.getParent()).removeView(view); // <- fix