getwidth()方法过时:
Display
d = manager.getDefaultDisplay()
;
WindowManager.LayoutParams p = dialogWindow.getAttributes()
Point size =
new
Point()
;
d.getSize(size)
;
int
width = size.
x
;
int
height = size.
y
;
p.
height
= (
int
) (height *
0.4
)
;
// 高度设置为屏幕的0.6,根据实际情况调整
p.
width
= (
int
) (width *
0.5
)
;
// 宽度设置为屏幕的0.65,根据实际情况调整
getcolor()方法过时:
ContextCompat
.getColor
(Context context,
int
id
);