美文网首页
Android自定义SearchView字体

Android自定义SearchView字体

作者: 库珀丨Cooper | 来源:发表于2017-10-20 17:07 被阅读0次
    int id = searchViewRes.getContext().getResources().getIdentifier("android:id/search_src_text",null,null);
            TextView textView = (TextView) searchViewRes.findViewById(id);
            textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16);
            LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
                    ViewGroup.LayoutParams.WRAP_CONTENT);
            layoutParams.gravity = Gravity.CENTER_VERTICAL;
            textView.setLayoutParams(layoutParams);
    

    相关文章

      网友评论

          本文标题:Android自定义SearchView字体

          本文链接:https://www.haomeiwen.com/subject/msvvuxtx.html