我正试图在actionbar项目上创建一个弹出窗口(就像G+应用程序中的那个)。
要做到这一点,我需要有actionbar项视图,但这只能使用setActionView()设置一个自定义视图。
问题是,我不能访问相同的菜单项样式的actionbar项目。
我用的是:
<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">
但结果并不好。
在哪里可以找到模仿动作栏项目一的布局/样式?
发布于 2013-08-07 10:12:53
解决方案是使用此布局:
<?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
https://stackoverflow.com/questions/18060255
复制相似问题