Kotlin - custom dialog in Android

后端 未结 6 1553
醉话见心
醉话见心 2020-12-30 20:00

I want to create a custom dialog in Kotlin. I looked through questions on this theme on Stack Overflow, but I could not find any useful informa

6条回答
  •  隐瞒了意图╮
    2020-12-30 20:22

    custom_dialog.xml

    
    
    
        
    
            
    
            
    
            

    CustomDialogClass.kt

    class CustomDialogClass(context: Context) : Dialog(context) {
        
            init {
                setCancelable(false)
            }
        
            override fun onCreate(savedInstanceState: Bundle?) {
                super.onCreate(savedInstanceState)
                requestWindowFeature(Window.FEATURE_NO_TITLE)
                setContentView(R.layout.custom_dialog)
        
            }
    }
    

提交回复
热议问题