【问题标题】:Android: Deleting Shadow of Default ActionBar [duplicate]Android:删除默认ActionBar的阴影[重复]
【发布时间】:2017-09-23 19:29:17
【问题描述】:

有没有办法从默认的 ActionBar 中移除阴影?我只找到使用“noActionBar”作为默认布局的自定义 ActionBar 的解决方案。

【问题讨论】:

    标签: android layout


    【解决方案1】:
    getWindow().requestFeature(Window.FEATURE_ACTION_BAR); 
    getSupportActionBar().setElevation(0);
    

    注意:转到要删除 ActionBar 的 Elevation 的活动。在 setContent(....) 之前,请求 ActionBar 功能(即如果你没有直接声明)

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)        
        {
            toolbar.setElevation(0.0f);
        }
    

    【讨论】:

      猜你喜欢
      • 2015-04-13
      • 2021-02-24
      • 2013-10-03
      • 1970-01-01
      • 2020-07-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多