简体   繁体   English

在android studio中按下时UI闪烁

[英]UI flickering while back pressed in android studio

I have an android app with a number of activities.我有一个包含许多活动的 android 应用程序。 While switching between activities and then press back button a very short flickering occurs.在活动之间切换然后按下后退按钮时,会发生非常短的闪烁。 I test adding this line in both onBackPressed and onResume :我测试在onBackPressedonResume添加这一行:

overridePendingTransition(0,0);

also I add this line to my theme style:我还将这一行添加到我的主题样式中:

<item name="android:windowAnimationStyle">@null</item>

I did not find any solution.我没有找到任何解决方案。 here is a short video:这是一个简短的视频:
在此处输入图片说明 Thanks for any help谢谢你的帮助

You can add this line to your theme style.您可以将此行添加到您的主题样式中。 It will delay a little bit the presentation by removing the flickering.它会通过消除闪烁来稍微延迟演示。

<item name="android:windowDisablePreview">true</item>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM