美文网首页
关于App与Activity的Theme

关于App与Activity的Theme

作者: 钦_79f7 | 来源:发表于2019-12-19 12:53 被阅读0次
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/background</item>
    <!--<item name="android:background">@color/transparent</item>-->
    <item name="android:textSize">14dp</item>
    <item name="android:textColor">@color/text_black_light</item>
    <item name="android:windowAnimationStyle">@style/AnimationActivity</item>
    <item name="android:windowBackground">@color/transparent</item>
</style>

设置Activity的动画主题

<style name="AnimationActivity" parent="@android:style/Animation.Activity">
    <!--打开Activity时新Activity的动画-->
    <item name="android:activityOpenEnterAnimation">@anim/slide_right_in</item>
    <!--打开Activity时旧Activity的动画-->
    <!--<item name="android:activityOpenExitAnimation">@anim/slide_right_out</item>-->
    <!--关闭Activity时将要展示的Activity的展示动画-->
    <!--<item name="android:activityCloseEnterAnimation">@anim/slide_left_in</item>-->
    <!--关闭Activity时被关闭的Activity的动画-->
    <item name="android:activityCloseExitAnimation">@anim/slide_left    out</item>
</style>

相关文章

网友评论

      本文标题:关于App与Activity的Theme

      本文链接:https://www.haomeiwen.com/subject/wbemnctx.html