Pat*_*ney 2 android toast android-xml
我知道我可以使用自定义Toast布局轻松完成所有这些操作,但在创建自定义布局时,我将不再使用系统的默认Toast视图.
示例:Android 2.2与Android 4.0的Toast当然看起来不同.如果我为我的吐司创建一个自定义视图,那么它在两个版本中都会看起来完全相同,但我想要的是保留它的......"Androidiness",因为缺少一个更好的单词.基本上,有没有人知道默认的toast XML布局?这甚至可能吗?
这是使用的默认布局Toasts.
transient_notification
<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>
Run Code Online (Sandbox Code Playgroud)
这些是进入和退出动画
输入
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@interpolator/decelerate_quad"
android:fromAlpha="0.0" android:toAlpha="1.0"
android:duration="@android:integer/config_longAnimTime" />
Run Code Online (Sandbox Code Playgroud)
出口
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@interpolator/accelerate_quad"
android:fromAlpha="1.0" android:toAlpha="0.0"
android:duration="@android:integer/config_longAnimTime" />
Run Code Online (Sandbox Code Playgroud)
toast_frame_holo.9是用于后台的资源的名称.搜索SDK以查找所有尺寸.
如果你不确定这些,请在SDK中搜索所有资源,这就是我所看到的.
| 归档时间: |
|
| 查看次数: |
5839 次 |
| 最近记录: |