Esempio n. 1
0
        /// <summary>
        /// Sets photo upload button attributes.
        /// </summary>
        private void SetPhotoUploadButtonAttributes()
        {
            //get current view dimensions
            PhotoUploadButton.SizeToFit();
            var screenHeight = View.Frame.Height - Constants.NavBarHeight;
            var screenWidth  = View.Frame.Width;

            SetButtonProperties(PhotoUploadButton);
            //adjust the button position after every rotation
            PhotoUploadButton.Frame = new CGRect(
                0,
                Constants.NavBarHeight,
                screenWidth,
                screenHeight / SharedConstants.NumberOfImageUploadComponents);
            PhotoUploadButton.SetImage(PhotoUploadButton.ImageView.Image.ImageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal), UIControlState.Normal);
            var btnScaler = PhotoUploadButton.ImageView.Frame.Height / 2 - Constants.UploadBtnVerticalOffset;

            PhotoUploadButton.ImageEdgeInsets = new UIEdgeInsets(
                -btnScaler,
                (PhotoUploadButton.Frame.Width - PhotoUploadButton.ImageView.Frame.Width + Constants.UploadBtnHorizontalOffset) / 2,
                btnScaler,
                (PhotoUploadButton.Frame.Width - PhotoUploadButton.ImageView.Frame.Width - Constants.UploadBtnHorizontalOffset) / 2);
            PhotoUploadButton.TitleEdgeInsets   = new UIEdgeInsets(btnScaler, -PhotoUploadButton.ImageView.Frame.Width, -btnScaler, 0);
            PhotoUploadButton.ContentEdgeInsets = new UIEdgeInsets(
                btnScaler,
                0,
                btnScaler,
                0);
        }
Esempio n. 2
0
 private void AccessibilityHandler()
 {
     GalleryButton.SetNeedsLayout();
     PhotoUploadButton.SetNeedsLayout();
 }