首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >安卓BottomSheetDialogFragment闪烁

安卓BottomSheetDialogFragment闪烁
EN

Stack Overflow用户
提问于 2020-09-10 10:55:47
回答 1查看 530关注 0票数 0

I startActivity from BottomSheetDialogFragment。

但当我完成这项活动时,BottomSheetDialogFragment开始闪烁。

我的案例是这样的BottomSheetDialog background blinking

但目前还没有解决方案。

Here is my screen shot

代码很简单,很基本。

MainActivity.class

代码语言:javascript
复制
class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        val bottomSheetFragment = BottomSheetFragment()

        button.setOnClickListener {

            bottomSheetFragment.show(supportFragmentManager, "")
        }
    }
}

BottomSheetFragment.class

代码语言:javascript
复制
class BottomSheetFragment: BottomSheetDialogFragment() {

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {

        return inflater.inflate(R.layout.fragment_bottom_sheet, container, false)
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)

        button.setOnClickListener {

            startActivity(Intent(context!!, Test2Activity::class.java))
        }
    }
}
EN

回答 1

Stack Overflow用户

发布于 2020-09-10 21:05:32

你的底纸没有闪烁。当你回到MainActivity时,这是活动的效果。在您的MainActivity中,请在onCreate()之前实现overridePendingTransition

overridePendingTransition(0,0) //由于此默认效果将被移除

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63822156

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档