我从我的SurfaceView对象中得到O尽管在构造函数中我在构造函数中得到一个非零值。
mView=new MainView(this);
FrameLayout fL=new FrameLayout(this);
fL.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT));
Button zoomIn=new Button(this);
zoomIn.setLayoutParams(new LayoutParams(mView.getwidth()/50,mView.getwidth()/50));
zoomIn.setX(mView.getwidth()/2);
zoomIn.setY(mView.getHeight()/2);
zoomIn.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
mView.mThread.testzoom(1.5f);
mView.mThread.zBackground.setZoomedBitmap();
}
});
fL.addView(mView);
fL.addView(zoomIn);
Log.e("MainActivity","First Start of MainActivity");
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(fL);
我只是想让我的按钮以框架布局为中心...(布局框架来自framelayout,因为我正在导入它所以jsut需要调用LayoutParams.xxxxxx)
为什么会这样?我的按钮在x和y中有0个维度!!!