wuqianshmily 2014-03-05 07:24
浏览 2792

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 ,求帮忙啊!

  • 写回答

0条回答

    报告相同问题?

    悬赏问题

    • ¥15 手机连接电脑热点显示无ip分配
    • ¥15 delta降尺度计算的一些细节,有偿
    • ¥15 Arduino红外遥控代码有问题
    • ¥15 数值计算离散正交多项式
    • ¥30 数值计算均差系数编程
    • ¥15 redis-full-check比较 两个集群的数据出错
    • ¥15 Matlab编程问题
    • ¥15 训练的多模态特征融合模型准确度很低怎么办
    • ¥15 kylin启动报错log4j类冲突
    • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大