2 u010270548 u010270548 于 2014.03.05 15:24 提问

android横屏后图片没有充满layout

m_iVideoLayout = new AbsoluteLayout(this.getContext());//新建layout

m_iVideoBaseLayout.addView(m_iVideoLayout, new AbsoluteLayout.LayoutParams(iVideoImageWidth, iVideoImageHeigt, 0, (iVideoAreaHeight-iVideoImageHeigt)/2 + iTitleAreaHeight ));

m_iImageView = new ImageView(this.getContext());//新建ImageView
m_iVideoLayout.addView(m_iImageView, new RelativeLayout.LayoutParams(GridLayout.LayoutParams.MATCH_PARENT,GridLayout.LayoutParams.MATCH_PARENT));//设置ImageView的布局

监听手机横屏函数:

RotateAnimation rotateAnimation = new RotateAnimation(0, 90, centerX,
centerY);
rotateAnimation.setDuration(0);
rotateAnimation.setFillAfter(true);

//改变layout的params
AbsoluteLayout.LayoutParams params = (LayoutParams) m_iVideoLayout.getLayoutParams();
params.width = height;
params.height = width;
params.y = GlobalDefine.GetYScale(78)+y;
params.x = x;

m_iVideoLayout.setLayoutParams(params);
m_iVideoLayout.startAnimation(rotateAnimation);
横屏之后,为什么imageView不能充满整个layout??
再竖屏之后又可以充满layout
怎样才能充满整个layout ,求帮忙啊!

Csdn user default icon
上传中...
上传图片
插入图片