1、onCreate中 加载XML 然后代码中设置全屏
setContentView(R.layout.dialog_bottom_layout)
val layoutParams = window.attributes
layoutParams.width = WindowManager.LayoutParams.MATCH_PARENT
window.attributes = layoutParams
布局文件
<LinearLayout xmlns...
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom"
android:orientation="vertical">
<View
android:id="@+id/dialog_selectbottom_view"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginBottom="8dp"
android:layout_weight="1"/>
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"