我正在工作的一个子类的FrameLayout,应该是将所有的孩子旋转90度。我这样做是为了克服Android 2.1及以下版本中仅存在于风景中的摄像机限制,将活动放置在横向,但将我的摄像机覆盖放置在此framelayout覆盖中,以使其看起来像是纵向(
this is how Layar does it)到完成这个,我适应
Jeff Sharkey’s code旋转视图。我的问题是,我可以旋转Framelayout,但我不能调整它以匹配新的维度。所以在我的g1,而不是一个320×480纵向视图在480×320相机视图的风景,我得到一个320×320盒子在中间显示我的肖像视图与侧面切碎。
这里是我的代码到目前为止:
public class RotateLayout extends FrameLayout {
private Matrix mForward = new Matrix();
private Matrix mReverse = new Matrix();
private float[] mTemp = new float[2];
public RotateLayout(Context context) {
super(context);
}
public RotateLayout(Context context, AttributeSet attrs) {
super(context, attrs);
}
/* (non-Javadoc)
* @see android.widget.FrameLayout#onMeasure(int, int)
*/
@Overr