Android中实现Toast效果Dialog自动消失 更新
- UID
- 1066743
|
Android中实现Toast效果Dialog自动消失 更新
R.layout.dialog_customize_toast布局代码
<?xml version="1.0" encoding="utf-8"?>
<!--自定义Toast样式dialog弹框布局-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="@dimen/dimen_515"
android:layout_height="@dimen/dimen_320"
android:background="@drawable/bg_round_white_shape"
android:gravity="center"
android:padding="@dimen/dimen_20"
androidrientation="vertical">
<ImageView
android:id="@+id/iv_dialog_toast_icon"
style="@style/style_wrap_content"
android:contentDescription="@null"/>
<TextView
android:id="@+id/tv_dialog_toast_content"
style="@style/style_wrap_content"
android:layout_marginTop="@dimen/dimen_20"
android:textSize="@dimen/text_26"
android:textColor="@color/c_black_2"
android:maxLines="2"/>
</LinearLayout>
3、 R.style.style_dialog 样式代码
<!-- 自定义DialogActivity样式-->
<style name="style_dialog" parent="android:style/Theme.Dialog">
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowFrame">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
<item name="android:backgroundDimEnabled">true</item>
</style> |
|
|
|
|
|