Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在xamarin中更改listview中的文本颜色_Listview_Xamarin_Xamarin.forms - Fatal编程技术网

如何在xamarin中更改listview中的文本颜色

如何在xamarin中更改listview中的文本颜色,listview,xamarin,xamarin.forms,Listview,Xamarin,Xamarin.forms,这是我在my edit.cs中的代码 var db = new SQLiteConnection(_dbPath); StackLayout stackLayout = new StackLayout(); _listView = new ListView(); _listView.ItemsSource = db.Table<SpeechRecTable>().OrderBy(x

这是我在my edit.cs中的代码


            var db = new SQLiteConnection(_dbPath);

            StackLayout stackLayout = new StackLayout();

            _listView = new ListView();
            _listView.ItemsSource = db.Table<SpeechRecTable>().OrderBy(x => x.Text).ToList();
            _listView.ItemSelected += _listView_ItemSelected;
            //_listView.SeparatorColor = Color.WhiteSmoke;
            stackLayout.Children.Add(_listView);

            _button = new Button();
            _button.Text = "UPDATE";
            _button.BackgroundColor = Color.Coral;
            _button.TextColor = Color.WhiteSmoke;
            _button.Clicked += _button_Clicked;
            stackLayout.Children.Add(_button);

            Content = stackLayout;



var db=新的SQLiteConnection(_dbPath);
StackLayout StackLayout=新的StackLayout();
_listView=新建listView();
_listView.ItemsSource=db.Table().OrderBy(x=>x.Text).ToList();
_listView.ItemSelected+=\u listView\u ItemSelected;
//_listView.SeparatorColor=Color.WhiteSmoke;
stackLayout.Children.Add(_listView);
_按钮=新按钮();
_button.Text=“更新”;
_button.BackgroundColor=Color.Coral;
_button.TextColor=Color.WhiteSmoke;
_按钮。单击+=\u按钮\u单击;
stackLayout.Children.Add(_按钮);
内容=堆栈布局;
默认颜色看起来像粉红色,我在listview中找不到textcolor属性


我是xamarin的新手,我正在尝试创建一个CRUD应用程序,我遵循本教程:

您可以从参考资料中更改Android口音颜色

Resources/Android/values/colors.xml

<resources>
<color name="launcher_background">#FFFFFF</color>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>

#FFFFFF
#3F51B5
#303F9F
#FF4081

默认颜色设置为粉红色,您可以使用UI配色方案中的颜色套装进行更改。但请记住:如果更改此选项,则使用强调色的控件也会受到影响


您可以从中了解有关Android样式和主题的详细信息。

您的
列表视图的
ViewCell
?要更改Android中的默认颜色,请转到Android项目>资源>值>颜色。xml@FreakyAli这是教程中的代码,它不是一个xaml.cs文件,只是,csfile@AnasAlweish我在styles.xml找到了它,谢谢你指出,它就在color.xml:D谢谢你