Android的:如何设置敬酒的文本的颜色如何设置、文本、颜色、Android

2023-09-03 22:10:04 作者:夜微涼ミ雨輕傷

我显示敬酒消息if语句使用下面的code的结果是:

I am displaying a toast message as the result of an if statement using the following code:

Toast.makeText(getBaseContext(),请输入价格,Toast.LENGTH_SHORT).show();

Toast.makeText(getBaseContext(), "Please Enter Price", Toast.LENGTH_SHORT).show();

有被显示为白色文字,白色背景,因此它不能被读!我的问题是,我怎么可以改变面包的文本的颜色?

It is displayed as white text on a white background, as such it can not be read! My question is, how can I change the colour of the toast's text?

推荐答案

您可以创建自定义吐司,以满足您的要求。见标题为创建自定义吐司视图在http://developer.android.com/guide/topics/ui/notifiers/toasts.html

You can create a custom Toast view to suit your requirements. See the section titled "Creating a Custom Toast View" at http://developer.android.com/guide/topics/ui/notifiers/toasts.html