-
Notifications
You must be signed in to change notification settings - Fork 53
Open
Description
当我在 Activity 中使用 Android 35 版本的 enableEdgeToEdge() 方法实现沉浸式的时候,如果同时使用本库设置标题栏,则标题栏会和手机状态栏重叠。代码形如下:
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
setContentView(R.layout.activity_post)
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
insets
}
decorateContentView(this)
setToolbar("标题")
}
Metadata
Metadata
Assignees
Labels
No labels