I would like to set the ActionBar size to 80dp. I'm trying this but isn't working:
<style name="LargeActionBar" parent="Base.Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/primary</item>
<item name="colorPrimaryDark">@color/primary_dark</item>
<item name="colorAccent">@color/accent</item>
<item name="actionBarStyle">@style/LargeActionBar.Large</item>
<item name="android:actionBarStyle">@style/LargeActionBar.Large</item>
</style>
<style name="LargeActionBar.Large" parent="Base.Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="android:background">@color/primary</item>
<item name="android:height">80dp</item>
<item name="height">80dp</item>
<item name="actionBarSize">80dp</item>
</style>
Activity:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity);
ActionBar actionBar = getSupportActionBar();
setTheme(R.style.LargeActionBar);
actionBar.setDisplayShowHomeEnabled(false);
actionBar.setDisplayShowTitleEnabled(false);
LayoutInflater inflater = LayoutInflater.from(this);
View customView = inflater.inflate(R.layout.layout_actionbar,null);
actionBar.setCustomView(customView);
actionBar.setDisplayShowCustomEnabled(true);
I've tried it in two different ways, using setTheme
andLayoutInflater
. Is it possible that one is interfering in the other?