Skip to content

Latest commit

 

History

History
91 lines (62 loc) · 2.57 KB

README.md

File metadata and controls

91 lines (62 loc) · 2.57 KB

Xamarin.EnableKeyboardEffect

This effect allows user to show/hide softkeyboard on Android/iOS platform in Xamarin.Forms

Building Status

Setup

  • Need Xamarin.Forms version 3 or above
  • Xamarin.EnableKeyboardEffect Available on NuGet: https://www.nuget.org/packages/Xamarin.EnableKeyboardEffect
  • Install into your platform-specific projects (iOS/Android), and any .NET Standard 2.0 projects required for your app.
  • Add xmlns:effects="clr-namespace:Xamarin.EnableKeyboardEffect;assembly=Xamarin.EnableKeyboardEffect" at the top of the xaml file

Platform Support

Platform Supported Version Notes
Xamarin.iOS Yes iOS 8+
Xamarin.Android Yes API 16+ Project should target Android framework 8.1+

For iOS

        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();

            Xamarin.EnableKeyboardEffect.iOS.Effects.Init();//need this line to init effect in iOS

            LoadApplication(new App());
            return base.FinishedLaunching(app, options);
        }

Usage

Show soft keyboard

        <Entry Text="Show Keyboard" effects:EnableKeyboardEffect.EnableKeyboard="True">
            <Entry.Effects>
                <effects:KeyboardEnableEffect/>
            </Entry.Effects>
        </Entry>

Hide soft keyboard

        <Entry Text="Hide Keyboard" effects:EnableKeyboardEffect.EnableKeyboard="False">
            <Entry.Effects>
                <effects:KeyboardEnableEffect/>
            </Entry.Effects>
        </Entry>

Bind Boolean property to effect

        <Entry Text="Toggle Keyboard" effects:EnableKeyboardEffect.EnableKeyboard="{Binding VisibleBinding}">
            <Entry.Effects>
                <effects:KeyboardEnableEffect/>
            </Entry.Effects>
        </Entry>

Demo

Android

iOS

Limitations

Only support Android and iOS for the moment.

Contributing

Contributions are welcome. Feel free to file issues and pull requests on the repo and they'll be reviewed as time permits.

License

Under MIT, see LICENSE file.