当前位置: 首页>>代码示例>>Java>>正文


Java AutoCompleteTextView.setHintTextColor方法代码示例

本文整理汇总了Java中android.widget.AutoCompleteTextView.setHintTextColor方法的典型用法代码示例。如果您正苦于以下问题:Java AutoCompleteTextView.setHintTextColor方法的具体用法?Java AutoCompleteTextView.setHintTextColor怎么用?Java AutoCompleteTextView.setHintTextColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.AutoCompleteTextView的用法示例。


在下文中一共展示了AutoCompleteTextView.setHintTextColor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createAutoCompleteTextView

import android.widget.AutoCompleteTextView; //导入方法依赖的package包/类
private AutoCompleteTextView createAutoCompleteTextView(Context context) {
    final LayoutParams lparamsTextView = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
    lparamsTextView.setMargins(0, 0, 10, 0);
    lparamsTextView.gravity = Gravity.CENTER;
    final AutoCompleteTextView autoCompleteTextView = new AutoCompleteTextView(context);
    autoCompleteTextView.setBackgroundColor(Color.parseColor("#00FFFFFF"));
    autoCompleteTextView.setLayoutParams(lparamsTextView);
    autoCompleteTextView.setHint(" ");
    autoCompleteTextView.setPadding(10,0,10,10);
    autoCompleteTextView.setSingleLine(true);
    autoCompleteTextView.setTextColor(textColor);
    autoCompleteTextView.setHintTextColor(hintColor);
    autoCompleteTextView.setCursorVisible(true);

    return autoCompleteTextView;
}
 
开发者ID:OfficialAmal,项目名称:ChipLayout,代码行数:17,代码来源:ChipLayout.java

示例2: onPrepareOptionsMenu

import android.widget.AutoCompleteTextView; //导入方法依赖的package包/类
@Override
public void onPrepareOptionsMenu(Menu _Menu) {
    // TODO: try to remove this, it seems very very hacky
    // found at: http://stackoverflow.com/questions/10445760/how-to-change-the-default-icon-on-the-searchview-to-be-use-in-the-action-bar-on
    if (_Menu == null) {
        return;
    }
    MenuItem searchMenuItem = _Menu.findItem(R.id.menu_product_list_dialog_search);
    SearchView searchView = (SearchView) searchMenuItem.getActionView();
    searchMenuItem.setIcon(R.drawable.ic_search_white_36dp);


    int searchTextViewId = android.support.v7.appcompat.R.id.search_src_text;
    AutoCompleteTextView searchTextView = (AutoCompleteTextView) searchView.findViewById(searchTextViewId);
    searchTextView.setHintTextColor(getResources().getColor(R.color.white));
    searchTextView.setTextColor(getResources().getColor(android.R.color.white));
    searchTextView.setTextSize(16.0f);


    SpannableStringBuilder ssb = new SpannableStringBuilder("   "); // for the icon
    //ssb.append(hintText);
    Drawable searchIcon = getResources().getDrawable(R.drawable.ic_search_white_36dp);
    int textSize = (int) (searchTextView.getTextSize() * 1.25);
    searchIcon.setBounds(0, 0, textSize, textSize);
    ssb.setSpan(new ImageSpan(searchIcon), 1, 2, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
    searchTextView.setHint(ssb);
    super.onPrepareOptionsMenu(_Menu);
}
 
开发者ID:InstaList,项目名称:instalist-android,代码行数:29,代码来源:ProductListDialogFragment.java


注:本文中的android.widget.AutoCompleteTextView.setHintTextColor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。