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);
网友评论