android中为什么用vedioview播放视屏的时候不能占满屏幕

2026年09月25日 21:09
有2个网友回答
网友(1):

继承VideoView 重写onMeasure方法

@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int width = getDefaultSize(0, widthMeasureSpec);
int height = getDefaultSize(0, heightMeasureSpec);
setMeasuredDimension(width, height);
}

就可以全屏了

网友(2):

建议换rockplayer试试,高性能全格式播放器。