AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
AutosizesSubviews = false; Remove frame resizing, but leave in the contentsize change. Jon Von: [email protected] [mailto:[email protected]] Im Auftrag von Jon Hopkins Gesendet: 17 August 2011 13:54 Cc: [email protected] Betreff: [MonoTouch] rotation of paged UIScrollView Hi, Anyone got this working correctly. My VC is handling the events public override bool ShouldAutorotateToInterfaceOrientation (UIInterfaceOrientation toInterfaceOrientation) { return true; } public override void DidRotate (UIInterfaceOrientation fromInterfaceOrientation) { base.DidRotate (fromInterfaceOrientation); if (fromInterfaceOrientation == UIInterfaceOrientation.LandscapeLeft || fromInterfaceOrientation == UIInterfaceOrientation.LandscapeRight) { width = 768; height = 1024; } else { width = 1024; height = 768; } ScrollViewer.width = width; ScrollViewer.height = height; ScrollViewer.rotated(new SizeF(width, height)); } } And my UIScrollview .... public void rotated(SizeF newSize) { PagingEnabled = false; Frame.Size = newSize; RectangleF scrollFrame = Frame; scrollFrame.Width = width * pageCount; // w,h set in VC scrollFrame.Height = height; ContentSize = scrollFrame.Size; PagingEnabled = true; goPage(currentPage); // redraw } goPage will reload in the content in the correct format but it the scrollview stays at 768 width when in landscape mode, and generally screws up. The page size is also too narrow but not the same as the container width either. Ideas? Jon
_______________________________________________ MonoTouch mailing list [email protected] http://lists.ximian.com/mailman/listinfo/monotouch
