husonet | Tarih: 18.08.2014
Android SearchView Renklendirmesi Nasıl Yapılır?
SearchView Background, Hint, Text Renklendirmesi
Android SearchView bileşeninde Background 'Arka Plan', Hint ve Text renklendirmesi için aşağıdaki kodu uygulayabilirsiniz.
[code java] SearchView edSearch = (SearchView) findViewById(R.id.edSearch);
//edSearch.setOnClickListener(this);
//edSearch.setOnQueryTextListener(this);
edSearch.setQueryHint(Html.fromHtml("<font color = "+Color.LTGRAY+">Yük No...</font>"));
edSearch.setBackgroundColor(Color.rgb(74, 105, 165));
// edSearch.setIconifiedByDefault(true);
// Renklendirme
int id = edSearch.getContext()
.getResources()
.getIdentifier("android:id/search_src_text", null, null);
TextView textView = (TextView) edSearch.findViewById(id);
textView.setTextColor(Color.LTGRAY);[/code]
[code java] SearchView edSearch = (SearchView) findViewById(R.id.edSearch);
//edSearch.setOnClickListener(this);
//edSearch.setOnQueryTextListener(this);
edSearch.setQueryHint(Html.fromHtml("<font color = "+Color.LTGRAY+">Yük No...</font>"));
edSearch.setBackgroundColor(Color.rgb(74, 105, 165));
// edSearch.setIconifiedByDefault(true);
// Renklendirme
int id = edSearch.getContext()
.getResources()
.getIdentifier("android:id/search_src_text", null, null);
TextView textView = (TextView) edSearch.findViewById(id);
textView.setTextColor(Color.LTGRAY);[/code]