因此,既然发布了Android 5.0,我想知道如何实现动画的操作栏图标。
该库在这里实现它为我好,但由于程序兼容性V7图书馆它怎么能实现?
该库在themes.xml中引用了它
<item name="drawerArrowStyle">@style/Widget.AppCompat.DrawerArrowToggle</item>
在这种风格下
<style name="Base.V7.Theme.AppCompat" parent="Platform.AppCompat">
更新
我使用v7 DrawerToggle实现了此功能。但是我不能定型。请帮忙
我在v7 styles_base.xml中找到了样式
<style name="Base.Widget.AppCompat.DrawerArrowToggle" parent="">
<item name="color">?android:attr/textColorSecondary</item>
<item name="thickness">2dp</item>
<item name="barSize">18dp</item>
<item name="gapBetweenBars">3dp</item>
<item name="topBottomBarArrowSize">11.31dp</item>
<item name="middleBarArrowSize">16dp</item>
<item name="drawableSize">24dp</item>
<item name="spinBars">true</item>
</style>
我将此添加到了样式中,但没有用。还添加到我的attr.xml
<declare-styleable name="DrawerArrowToggle">
<!-- The drawing color for the bars -->
<attr name="color" format="color"/>
<!-- Whether bars should rotate or not during transition -->
<attr name="spinBars" format="boolean"/>
<!-- The total size of the drawable -->
<attr name="drawableSize" format="dimension"/>
<!-- The max gap between the bars when they are parallel to each other -->
<attr name="gapBetweenBars" format="dimension"/>
<!-- The size of the top and bottom bars when they merge to the middle bar to form an arrow -->
<attr name="topBottomBarArrowSize" format="dimension"/>
<!-- The size of the middle bar when top and bottom bars merge into middle bar to form an arrow -->
<attr name="middleBarArrowSize" format="dimension"/>
<!-- The size of the bars when they are parallel to each other -->
<attr name="barSize" format="dimension"/>
<!-- The thickness (stroke size) for the bar paint -->
<attr name="thickness" format="dimension"/>
</declare-styleable>
但是当崩溃时会说颜色类型错误。我想念什么?
mDrawerToggle.syncState();
修好了。