android:layout_height ="?attr/actionBarSize"不适用于support:design:23.0.0'库 [英] android:layout_height="?attr/actionBarSize" is not working with support:design:23.0.0' library

查看:97
本文介绍了android:layout_height ="?attr/actionBarSize"不适用于support:design:23.0.0'库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果设置android:layout_height="56dp",则可以在图形布局中看到工具栏.但是当我像下面这样设置时,

If I set android:layout_height="56dp", I can see the toolbar in graphical layout. But when I set like the below,

       <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="@color/purple"
            android:gravity="center_vertical"
            android:minHeight="?attr/actionBarSize"
            app:layout_scrollFlags="scroll|enterAlways"
            app:popupTheme="@style/ThemeOverlay.AppCompat.Light">  </android.support.v7.widget.Toolbar>

工具栏未以图形布局显示.

toolbar is not showing in graphical layout.

Studio表示attr/actionBarSize被标记为私有.

Studio says that attr/actionBarSize is marked as private.

我正在使用

 compile 'com.android.support:appcompat-v7:23.0.0'
 compile 'com.android.support:design:23.0.0'

可能是什么问题?我该如何解决!是的,Studio已更新.

What could be the issue? How can i fix it! Yes, Studio is updated.

推荐答案

使用?android:attr/actionBarSize代替?attr/actionBarSize

这篇关于android:layout_height =&quot;?attr/actionBarSize&quot;不适用于support:design:23.0.0'库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆