DialogFragment 全屏显示
生活随笔
收集整理的這篇文章主要介紹了
DialogFragment 全屏显示
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
https://stackoverflow.com/questions/7189948/full-screen-dialogfragment-in-android
1.重寫onCreateDialog方法
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {val root = RelativeLayout(activity)root.layoutParams = ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)val dialog = Dialog(activity)dialog.requestWindowFeature(Window.FEATURE_NO_TITLE)dialog.setContentView(root)dialog.window!!.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))dialog.window!!.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)return dialog} 《新程序員》:云原生和全面數字化實踐50位技術專家共同創作,文字、視頻、音頻交互閱讀總結
以上是生活随笔為你收集整理的DialogFragment 全屏显示的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 国际油价大跳水,美油布油均跌超3%!发生
- 下一篇: Kotlin中的接口回调