相关疑难解决方法(0)

如何从Android appcompat v7 21库实现DrawerArrowToggle

所以现在Android 5.0发布了,我想知道如何实现动画操作栏图标.

这个库在这里实现它很好但是因为appcompat v7库有它如何实现它?

该库在themes.xml中引用它

 <item name="drawerArrowStyle">@style/Widget.AppCompat.DrawerArrowToggle</item>
Run Code Online (Sandbox Code Playgroud)

在这种风格下

 <style name="Base.V7.Theme.AppCompat" parent="Platform.AppCompat">
Run Code Online (Sandbox Code Playgroud)

UPDATE

我使用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>
Run Code Online (Sandbox Code Playgroud)

我把它添加到我的样式中并且没有用.也添加到我的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 …
Run Code Online (Sandbox Code Playgroud)

android android-appcompat android-actionbar drawertoggle android-5.0-lollipop

97
推荐指数
4
解决办法
10万
查看次数