How to create a Custom Dialog box in android?

后端 未结 22 2800
囚心锁ツ
囚心锁ツ 2020-11-21 07:06

I want to create a custom dialog box like below

\"enter

I have tried the foll

22条回答
  •  心在旅途
    2020-11-21 07:38

    Following is the code for creating custom view dialog with kotlin. Following is the dialog layout file

    
    
    
        
    
    
    
    

    creating dialog and updating the text in the text view

    val dialog = Dialog(activity!!)
    dialog.setContentView(R.layout.my_dialog_layout)
    dialog.tvTitle.text = "Hello World!!"
    dialog.show()
    

提交回复
热议问题