searchview 修改text,hint字体大小颜色怎么设置?
SearchView searchView = (SearchView)findViewById(R.id.search);
//设置输入字体颜色
if(searchView == null) { return;}
int id = searchView.getContext().getResources().getIdentifier("android:id/search_src_text", null, null);
TextView textView = (TextView) searchView.findViewById(id);
textView.setTextColor(Color.RED);//字体颜色
textView.setTextSize(20);//字体、提示字体大小
textView.setHintTextColor(Color.BLUE);//提示字体颜色**
SearchView searchView = (SearchView)findViewById(R.id.search);
//设置输入字体颜色
if(searchView == null) { return;}
int id = searchView.getContext().getResources().getIdentifier("android:id/search_src_text", null, null);
TextView textView = (TextView) searchView.findViewById(id);
textView.setTextColor(Color.RED);//字体颜色
textView.setTextSize(20);//字体、提示字体大小
textView.setHintTextColor(Color.BLUE);//提示字体颜色
search View不报空,textView报空呢