J'ai créé une vue dans le générateur d'interface qui contient une autre vue (zone de contenu) et une barre de boutons en bas.Redimensionnement automatique des vues Monotouch dans l'iphone
La hiérarchie est aussi:
->View
--->mapContainer UIView
----->map MKMapView
----->OverlayView UIView
--->ToolBar UIToolBar
Je voudrais que le mapContainer redimensionner à la fenêtre complète quand elle est masquée. Je voudrais que la carte et le OverlayView pour redimensionner à la carteContainer size
J'ai essayé le code suivant, mais il n'a aucun effet. S'il vous plaît donnez votre avis?
public override void ViewDidLoad()
{
base.ViewDidLoad();
this.mapContainer.AutosizesSubviews = true ;
this.View.AutosizesSubviews = true ;
try
{
this.mapContainer.AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth ;
this.map.AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth ;
this.map.SizeToFit();
this.mapContainer.SizeToFit();
this.map.SizeToFit();
this.View.Frame = new System.Drawing.RectangleF(0,0,this.View.Frame.Width, this.View.Frame.Height);
this.mapContainer.LayoutSubviews();
}
catch(Exception ex)
{
Console.Write(ex.ToString());
}
}