xml文件设置: android:id="@+id/mainmenu_view" android:layout_width="320dip" android:layout_height="180dip"
前台更改:
mSurfaceView = (SurfaceView) this.findViewById(R.id.mainmenu_view);
RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) mSurfaceView.getLayoutParams();
lp.width = 320;
lp.height = 218;
mSurfaceView.setLayoutParams(lp);
竖直方向大小是增大了38dip,但是增加的部分设置的背景没有效果,是黑的,什么问题?还有surfaceView的surfaceChanged方法怎么用,这个方法能不能解决我的问题啊?
前台更改:
mSurfaceView = (SurfaceView) this.findViewById(R.id.mainmenu_view);
RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) mSurfaceView.getLayoutParams();
lp.width = 320;
lp.height = 218;
mSurfaceView.setLayoutParams(lp);
竖直方向大小是增大了38dip,但是增加的部分设置的背景没有效果,是黑的,什么问题?还有surfaceView的surfaceChanged方法怎么用,这个方法能不能解决我的问题啊?
有的话在重新设置下颜色或者背景还有一种方法就是context.invalidate();