Rotate View Hierarchy 90 degrees

后端 未结 6 977
予麋鹿
予麋鹿 2020-11-28 03:33

I am working on a subclass of FrameLayout that is supposed to rotate all of its children by 90 degrees. I am doing this to overcome the landscape-only camera limitation pres

6条回答
  •  被撕碎了的回忆
    2020-11-28 04:13

    Try turning off children clipping of your view root: call setClipChildren(false) on parent of your RotateLayout and in onMeasure method of your RotateLayout put these lines:

    super.onMeasure(heightMeasureSpec, widthMeasureSpec);
    setMeasuredDimension(getMeasuredHeight(), getMeasuredWidth());
    

    I'm having basically the same problem as you and I still haven't tested my solution - I'll do it tomorrow and tell if it is working correctly.

提交回复
热议问题