Android 开发弹窗设置为屏幕的百分比高度

2021-12-21  本文已影响0人  为自己代颜_

直接上代码:

              val bottomSheet = v.findViewById<View>(R.id.ll_bg) as LinearLayout
                        bottomSheet!!.setBackgroundColor(Color.TRANSPARENT)
                        val originLayoutParams = v.layoutParams
                        originLayoutParams.height = (this@ChatRoomActivity.getRealPoint().y * 0.84).toInt() - StatusBarUtil.getNavigationBarHeight(this@ChatRoomActivity)
                        bottomSheet.layoutParams = originLayoutParams
上一篇下一篇

猜你喜欢

热点阅读