Android中去标题栏的方法

1、对应的application注册中:添加 android:theme="@style/Theme.AppCompat.NoActionBar"

 

 

android状态栏一体化(沉浸式状态栏)

https://blog.csdn.net/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

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值