【发布时间】:2018-07-11 05:56:53
【问题描述】:
我想更改 Xamarin.Android 中的搜索文本视图颜色。到目前为止,我已经尝试过以下代码
searchView = this.Activity.FindViewById<Android.Support.V7.Widget.SearchView (Resource.Id.searchView);
searchView.SetOnQueryTextListener(this);
var textViewId = searchView.Context.Resources.GetIdentifier("android:id/search_src_text", null, null);
var textView = (searchView.FindViewById(textViewId) as TextView);
if (textView != null)
textView.SetTextColor(global::Android.Graphics.Color.White);
当我尝试捕获 textView 时,我得到了 NULL
在textViewId 中,我得到了类似于126312727 的视图ID
任何人都可以在上面帮助我吗?
【问题讨论】:
标签: c# android xamarin xamarin.android