即(有微调等)打开一个弹出菜单视图里面显示三角形 [英] Show triangle inside the view that opens a popupmenu (like with a spinner)
问题描述
我有一个的ListView
它通过展示 POPUPMENU
处理的onclick事件。不过,我希望用户看到,可以单击景色内的小三角形。
I have a ListView
which handles onClick events by showing a PopUpMenu
. However, I want the user to see the little triangle inside the views that can be clicked.
我试图用一个微调
,因为该元素看起来像我后,但我不能设置微调称号
来比选择其他任何东西。
I tried using a Spinner
, because that element looks like what I'm after, but I can't set the title of the Spinner
to anything other than its options.
当然,我可以定做的一切,但因为这不是我想也许有一些已经在那里的新格局。我只是无法找到它自己。
Of course I could custom make everything but as this is not a new pattern I thought maybe there's already something out there. I just can't find it myself.
什么,我以后是示例:
推荐答案
如果您使用 ActionBarSherlock
,您可以用三角ABS用途:
If you use ActionBarSherlock
, you can use the triangle ABS uses:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
etc />
<ImageView
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:contentDescription="@string/expand_triangle"
android:src="@drawable/abs__spinner_ab_default_holo_light" />
</RelativeLayout>
这篇关于即(有微调等)打开一个弹出菜单视图里面显示三角形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!