Android自定义SearchView字体
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
网友评论