Note that there are some explanatory texts on larger screens.

plurals
  1. POUIButton not showing in UIView Xamarin
    text
    copied!<p>I followed one of the Xamarin recipes (found here: <a href="http://docs.xamarin.com/recipes/ios/standard_controls/popovers/display_a_loading_message" rel="nofollow">http://docs.xamarin.com/recipes/ios/standard_controls/popovers/display_a_loading_message</a>), but instead of using a activity spinner I wanted to add a UIButton instead. I subbed out the activity spinner and am left with the following UIView class, however when I load the view the button is not loading/visible, however the label I've added is visible. Any Ideas?</p> <p>Source Code: </p> <pre><code>public class testOverlay : UIView { UIButton buttonRect; UILabel testLabel; public testOverlay (RectangleF frame) : base (frame) { // configurable bits BackgroundColor = UIColor.Black; Alpha = 0.75f; AutoresizingMask = UIViewAutoresizing.FlexibleDimensions; float labelHeight = 22; float labelWidth = Frame.Width - 20; // derive the center x and y float centerX = Frame.Width / 2; float centerY = Frame.Height / 2; // create the activity spinner, center it horizontall and put it 5 points above center x buttonRect = UIButton.FromType(UIButtonType.RoundedRect); buttonRect.SetTitle ("Confirm", UIControlState.Normal); buttonRect.Frame = new RectangleF ( centerX - (buttonRect.Frame.Width / 2) , centerY - buttonRect.Frame.Height - 20 , buttonRect.Frame.Width , buttonRect.Frame.Height); buttonRect.AutoresizingMask = UIViewAutoresizing.FlexibleMargins; AddSubview (buttonRect); // create and configure the "Loading Data" label testLabel = new UILabel(new RectangleF ( centerX - (labelWidth / 2), centerY + 20 , labelWidth , labelHeight )); testLabel.BackgroundColor = UIColor.Clear; testLabel.TextColor = UIColor.White; testLabel.Text = "Loading..."; testLabel.AutoresizingMask = UIViewAutoresizing.FlexibleMargins; AddSubview (testLabel); } /// &lt;summary&gt; /// Fades out the control and then removes it from the super view /// &lt;/summary&gt; public void Hide () { UIView.Animate ( 0.5, // duration () =&gt; { Alpha = 0; }, () =&gt; { RemoveFromSuperview(); } ); } }; </code></pre> <p>Thanks</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload