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 牛顿斯科特系数表表示
    • ¥15 arduino 步进电机
    • ¥20 程序进入HardFault_Handler
    • ¥15 oracle集群安装出bug
    • ¥15 关于#python#的问题:自动化测试
    • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题
    • ¥15 教务系统账号被盗号如何追溯设备
    • ¥20 delta降尺度方法,未来数据怎么降尺度
    • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
    • ¥15 再不同版本的系统上,TCP传输速度不一致