Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

startActivity with options 滑动返回会黑屏 #695

Closed
weiyf opened this issue Dec 25, 2017 · 7 comments · Fixed by #782
Closed

startActivity with options 滑动返回会黑屏 #695

weiyf opened this issue Dec 25, 2017 · 7 comments · Fixed by #782

Comments

@weiyf
Copy link

weiyf commented Dec 25, 2017

startActivity with options 滑动返回会黑屏

@YoKeyword
Copy link
Owner

Following information can help us to resolve the issue faster.

  • Library version
  • Support-v4 version
  • Logs
  • Screenshots

相关代码贴一下

@weiyf
Copy link
Author

weiyf commented Dec 29, 2017

就是demo, 滑动退出那个Activity

Bundle options = ActivityOptionsCompat.makeSceneTransitionAnimation(MainActivity.this,
                            findViewById(R.id.fl_container), "transition_top_bar").toBundle();
                    startActivity(new Intent(MainActivity.this, SwipeBackSampleActivity.class), options);

@YoKeyword
Copy link
Owner

好像是Options配置问题,对Options不是很熟,可以查下

@ruanbaojun1105
Copy link

加了转场动画就会返回黑屏,转场动画依旧能正常,就是背景成黑屏了,这是返回库的问题大兄弟,SwipeBackLayout的背景成黑色了?我还没找到方法

@ruanbaojun1105
Copy link

ruanbaojun1105 commented Jan 31, 2018

@weiyf @YoKeyword 我刚看了源码,找到了解决方法:
onCreate 初始化的时候加入下面这句代码可让转场动画正常
getWindow().getDecorView().setBackgroundColor(Color.TRANSPARENT);
因为源码中把这个背景设置成了null当然成黑色背景了

@YoKeyword
Copy link
Owner

@weiyf @ruanbaojun1105 研究了一下 R.id.fl_container这个View作为makeSceneTransitionAnimation的View在滑动时会看不到该View,换成nav_view或其他View 滑动返回时正常

点返回键会黑屏,如 @ruanbaojun1105 所说,需要把DecorView的background设置为透明即可解决,下一版本修复

@YoKeyword YoKeyword added the todo label Feb 11, 2018
YoKeyword added a commit that referenced this issue Feb 25, 2018
@YoKeyword YoKeyword mentioned this issue Feb 25, 2018
Merged
@YoKeyword
Copy link
Owner

已修复 v1.2.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants