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方法怎么用,这个方法能不能解决我的问题啊?
解决方案 »
- Android 上传下载文件的方法
- 开发Android需要学习一些什么知识?
- 请问在TabActivity里面的问题
- 怎么知道每一屏显示多少字合适
- android下两个usb摄像头的调用
- 如何开发一款android软件,调用联通超信的方法免费发信息给联通号码,有谁做过?
- adb移植
- popuwindows 如何实现边框 阴影 不是整个手机界面半透明
- android 4.4 GridView 抢焦点
- Error:Gradle 4.3.1 requires Java 7 or later to run.You are currently using Java6
- android 设定初期值的问题
- 如何调试android自带的应用程序?
有的话在重新设置下颜色或者背景还有一种方法就是context.invalidate();