【问题标题】:ActionBar actionView item styleActionBar actionView 项样式
【发布时间】:2013-08-07 18:12:53
【问题描述】:

我正在尝试在操作栏项目上创建一个弹出窗口(就像 G+ 应用程序中的那个)。

为此,我需要有操作栏项目视图,但这只能使用setActionView() 设置自定义视图。

问题是我无法达到与操作栏项目相同的菜单项样式。

我正在使用这个:

<Button xmlns:android="http://schemas.android.com/apk/res/android"
    style="?android:attr/actionButtonStyle"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:paddingLeft="12dp"
    android:paddingRight="12dp"
    android:background="@drawable/ic_refresh">

但结果并不好。

我在哪里可以找到一种布局/样式来模仿操作栏项目之一?

【问题讨论】:

    标签: android android-actionbar android-theme


    【解决方案1】:

    解决方案是使用这种布局:

        <?xml version="1.0" encoding="utf-8"?>
    <ImageButton xmlns:android="http://schemas.android.com/apk/res/android"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 style="@android:style/Widget.Holo.ActionButton"
                 android:src="@drawable/ic_refresh">
    
    </ImageButton>
    

    风格为@android:style/Widget.Holo.ActionButton

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多