Search This Blog

Tuesday 17 August 2021

Your Realtime database has insecure rules

Firebase Console/YourProject/RealTimeDatabase/Rules 

Add Following Rules in the Realtime database rules Section.

 "users": {
      "$uid": {
        ".write": "$uid === auth.uid",
        ".read": "$uid === auth.uid"
      }

how to remove navigation bar line in xamairn ios



Add following line in FinishedLaunching method of AppDelegate.cs

UINavigationBar.Appearance.ShadowImage = new UIImage();

AppDelegate.cs

using System;
using System.Collections.Generic;
using System.Linq;
using FFImageLoading.Forms.Platform;
using Foundation;
using UIKit;
 
namespace CollegeApp.iOS
{
    // The UIApplicationDelegate for the application. This class is responsible for launching the 
    // User Interface of the application, as well as listening (and optionally responding) to 
    // application events from iOS.
    [Register("AppDelegate")]
    public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
    {
        //
        // This method is invoked when the application has loaded and is ready to run. In this 
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            UINavigationBar.Appearance.ShadowImage = new UIImage();
            global::Xamarin.Forms.Forms.Init();
 
            Rg.Plugins.Popup.Popup.Init();
            CachedImageRenderer.Init();
            LoadApplication(new App());
 
            return base.FinishedLaunching(app, options);
        }
    }
}
 



Saturday 7 August 2021

How to set Xcode Path

Open the terminal in your mac.

Then write following command.

sudo xcode-select --switch /Applications/Xcode-beta.app/Contents/Developer 

Xamarin IOS Keyboard with done button.

Xamarin Form Project
BorderlessEntryWithDoneButton.cs
using System;
using System.Collections.Generic;
using System.Text;
using Xamarin.Forms;
 
namespace TestApp.Renderer
{
    public class BorderlessEntryWithDoneButton : Entry
    {
    }
}
Xamarin iOS Project
BorderlessEntryRendererWithDoneButton.cs
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
 
using Foundation;
using TestApp.iOS.CustomRenderers;
using TestApp.Renderer;
using UIKit;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
 
[assembly: ExportRenderer(typeof(BorderlessEntryWithDoneButton), typeof(BorderlessEntryRendererWithDoneButton))]
namespace TestApp.iOS.CustomRenderers
{
    public class BorderlessEntryRendererWithDoneButton : EntryRenderer
    {
        protected override void OnElementChanged(ElementChangedEventArgs<Entry> e)
        {
            base.OnElementChanged(e);
 
            if (Control != null && Element != null)
            {
                Control.BackgroundColor = Xamarin.Forms.Color.Transparent.ToUIColor();
                Control.Layer.BackgroundColor = Xamarin.Forms.Color.Transparent.ToCGColor();
                Control.BorderStyle = UITextBorderStyle.None;
                this.AddDoneButton();
            }
        }
 
        protected void AddDoneButton()
        {
            var toolbar = new UIToolbar(new RectangleF(0.0f, 0.0f, 50.0f, 44.0f));
            toolbar.BackgroundColor = UIColor.LightGray;
            var doneButton = new UIBarButtonItem(UIBarButtonSystemItem.Done, delegate
            {
                this.Control.ResignFirstResponder();
                var baseEntry = this.Element.GetType();
                ((IEntryController)Element).SendCompleted();
            });
 
            toolbar.Items = new UIBarButtonItem[] {
                new UIBarButtonItem (UIBarButtonSystemItem.FlexibleSpace),
                doneButton
            };
            this.Control.InputAccessoryView = toolbar;
        }
    }
}


Implementations

 <renderer:BorderlessEntryWithDoneButton   VerticalOptions="Center"   Text="{Binding Title}"  Placeholder="Event Name" "  />


Popular Posts