文档

搜索框

更新时间:

AUSearchInputBox (原 APSocialTagSearchBar)提供包含搜索框、右侧搜索按钮的搜索标题栏。使用该组件时,需要设置 View 的高度。

效果图

接口说明

   /**
     * 设置最大输入长度
     */
    public void setInputMaxLength();

    /**
     * 获取删除按钮
     * @return
     */
    public AUIconView getClearButton();

    /**
     * 获取搜索输入框
     * @return
     */
    public AUEditText getSearchEditView();

    /**
     * 获取语音搜索按钮
     * @return
     */
    public AUIconView getVoiceButton();

自定义属性

属性

说明

类型

isShowSearchBtn

是否显示搜索按钮。

boolean

isShowVoiceSearch

是否显示语音搜索。

boolean

searchEditText

搜索框默认文本。

string,reference

searchEditHint

搜索框默认提示内容。

string,reference

inputMaxLength

搜索框最长限制。

integer,reference

hintIconUnicode

编辑框左侧图标的 Unicode。

string,reference

hintIconDrawable

编辑框左侧图标的资源。

reference

editHintColor

编辑框内提示内容的颜色。

color,reference

editTextColor

编辑框内文本的颜色。

color,reference

editIconColor

编辑框内图标的颜色。

color,reference

代码示例

XML 示例:

<com.alipay.mobile.antui.basic.AUSearchInputBox
        android:layout_width="match_parent"
        android:layout_height="52dp"
        android:layout_marginTop="10dp"
        app:searchEditHint="暗文本提示" />
AUSearchInputBox inputBox = new AUSearchInputBox(this);
ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,300);
inputBox.setLayoutParams(layoutParams);

layout.addView(inputBox);
  • 本页导读 (0)
文档反馈