Android的Toast默认颜色和alpha [英] Android's Toast default colors and alpha

查看:990
本文介绍了Android的Toast默认颜色和alpha的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Toast组件的默认颜色是什么?内部深灰色,浅灰色边框颜色和alpha值?我双重检查了Toast.java的来源,但找不到它。

What are the default colors of the Toast component - the inner dark gray color, light gray border color and the value of alpha? I double checked the source of Toast.java but couldn't find it.

推荐答案

transient_notification layout xml:

So from the transient_notification layout xml:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical"
  android:background="@drawable/toast_frame">

  <TextView
    android:id="@android:id/message"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:textAppearance="@style/TextAppearance.Small"
    android:textColor="@color/bright_foreground_dark"
    android:shadowColor="#BB000000"
    android:shadowRadius="2.75"
    />

</LinearLayout>

这指向 res / drawable-hdpi / toast_frame.9.png 。然而,该图像似乎从版本到版本不同。你可以在你的android-sdk文件夹中找到这些文件夹, / platforms /<你想要的版本> / data / res

Which points to the res/drawable-hdpi/toast_frame.9.png. That image seems to vary from version to version though. You can find these in your android-sdk folder, inside /platforms/<the version you want>/data/res.

这篇关于Android的Toast默认颜色和alpha的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆