如何去除黑色背景之间在slide_left动画开始新的活动?背景、黑色、动画、slide_left

2023-09-04 23:21:21 作者:╭记忆、决眸酔伤°

当我调用由动画新的活动背景使黑色,所以我想删除黑色回地面所以我怎么能做到这一点? ?对于动画我使用

  getWindow()setBackgroundDrawableResource(R.drawable.mainbg_)。
overridePendingTransition(R.anim.push_up_in,0);
 

解决方案

设置活动的主题清单文件作为半透明

 安卓主题=@安卓风格/ Theme.Translucent
 
你的元旦祝福PPT动画模版,我已经帮你做好了 效果

让你的code会是这样

 <活动机器人:名称=。AdActivity
        机器人:主题=@安卓风格/ Theme.Translucent/>
 

when i call new activity by animation the background make black so i want to remove black back ground so how can i achieve this? ? For animation i use

 getWindow().setBackgroundDrawableResource(R.drawable.mainbg_); 
overridePendingTransition (R.anim.push_up_in,0);

解决方案

set the theme of that activity as transluscent in manifest file

android:theme="@android:style/Theme.Translucent"

so your code will be something like this

<activity android:name=".AdActivity"
        android:theme="@android:style/Theme.Translucent" />