【发布时间】:2010-07-25 16:12:41
【问题描述】:
我是关于搜索的 Android 开发人员文章:http://developer.android.com/guide/topics/search/index.html,我想知道是否可以将其他 UI 元素添加到 searchable.xml 文件中?这是我想做的:
<?xml version="1.0" encoding="utf-8"?>
<searchable xmlns:android="http://schemas.android.com/apk/res/android"
android:label="@string/app_name" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dip"
android:text="System:"/>
<Gallery
android:id="@+id/gallery"
android:layout_width="fill_parent"
android:layout_height="52px"
android:padding="8px"
android:unselectedAlpha="0.5"
android:spacing="3px">
</Gallery>
</searchable>
我想提供图库作为指定要搜索的类别的一种方式。这可能吗?如果是,我如何以及在哪里访问此组件的用户选择?如果没有,我还能如何实现让用户选择更具体地搜索?
【问题讨论】:
-
关于文档,我不确定您是否可以向可搜索元素添加内容?我从未使用过它,但我注意到没有可搜索的大写字母,因此没有直接链接到它的 Object 类......也许这需要我更多阅读:D
标签: java android xml user-interface search