|
1 | 1 | # Getting Started with Xamarin.iOS NumericTextBox |
2 | 2 |
|
3 | | -This section explains you the steps to configure a NumericTextBox control in a real-time scenario and also provides a walk-through on some of the customization features available in NumericTextBox control. |
4 | | - |
5 | | -## Reference Essential Studio Components in your Solution |
| 3 | +This repository contains sample to get started with the [Syncfusion Xamarin.iOS Numeric TextBox](https://help.syncfusion.com/xamarin-ios/sfnumerictextbox/getting-started) control. The Numeric TextBox is an advanced version of the Entry control that restricts input to numeric values. |
6 | 4 |
|
7 | | -After installing Essential Studio for Xamarin, you can find all the required assemblies in the installation folders, typically: |
| 5 | +## Syncfusion controls |
8 | 6 |
|
9 | | -{Syncfusion Installed location}\Essential Studio{version number}\lib |
| 7 | +This project used the following Syncfusion control(s): |
| 8 | +* [SfNumericTextBox](https://www.syncfusion.com/xamarin-ios-ui-controls/numeric-textbox) |
10 | 9 |
|
11 | | -N> Assemblies are available in unzipped package location in Mac |
| 10 | +## Requirements to run the sample |
12 | 11 |
|
13 | | -and below assembly reference to the iOS unified project. |
| 12 | +* [Visual Studio](https://visualstudio.microsoft.com/downloads/) or [Visual Studio for Mac](https://visualstudio.microsoft.com/vs/mac/) |
14 | 13 |
|
15 | | -iOS-unifed\Syncfusion.SfNumericTextBox.iOS.dll |
| 14 | +Refer to the following link for more details - [System Requirements](https://help.syncfusion.com/xamarin-ios/system-requirements) |
16 | 15 |
|
17 | | -## Add SfNumericTextBox |
| 16 | +## How to run the sample |
18 | 17 |
|
19 | | -* Adding namespace for the added assemblies. |
| 18 | +1. Clone the sample and open it in Visual Studio. |
20 | 19 |
|
21 | | -{% highlight c# %} |
| 20 | + *Note: If you download the sample using the "Download ZIP" option, right-click it, select Properties, and then select Unblock.* |
| 21 | + |
| 22 | +2. Register your license key in the FinishedLaunching override method of AppDelegate.cs file as demonstrated in the following code. |
22 | 23 |
|
23 | | -using Syncfusion.SfNumericTextBox.iOS; |
| 24 | + public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) |
| 25 | + { |
| 26 | + //Register Syncfusion license |
| 27 | + Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY"); |
24 | 28 |
|
25 | | -{% endhighlight %} |
| 29 | + // create a new window instance based on the screen size |
| 30 | + Window = new UIWindow(UIScreen.MainScreen.Bounds); |
26 | 31 |
|
27 | | -* Now add the SfNumericTextBox control with a required optimal name by using the included namespace. |
| 32 | + // If you have defined a root view controller, set it here: |
| 33 | + // Window.RootViewController = myViewController; |
28 | 34 |
|
29 | | -{% highlight c# %} |
| 35 | + // make the window visible |
| 36 | + Window.MakeKeyAndVisible(); |
30 | 37 |
|
31 | | -[C#] |
32 | | - |
33 | | -SfNumericTextBox numericTextBox = new SfNumericTextBox() |
34 | | -{ |
| 38 | + return true; |
| 39 | + } |
| 40 | + |
| 41 | + Refer to this [link](https://help.syncfusion.com/xamarin-ios/licensing/overview) for more details. |
35 | 42 |
|
36 | | - Frame = new CGRect(10, 50, 350, 40), |
37 | | -}; |
38 | | -this.Add(numericTextBox); |
39 | | - |
40 | | -{% endhighlight %} |
41 | | - |
42 | | -## Enable Parsing Mode |
| 43 | +3. Clean and build the application. |
43 | 44 |
|
44 | | -SfNumericTextBox provides option to display the value in double or decimal. Following code shows the Decimal parsing mode which can be set through `ParserMode` property. |
| 45 | +4. Run the application. |
45 | 46 |
|
46 | | -{% highlight c# %} |
47 | | - |
48 | | -[C#] |
49 | | - |
50 | | -numericTextBox.ParserMode = SFNumericTextBoxParsers.Decimal; |
51 | | - |
52 | | -{% endhighlight %} |
| 47 | +## License |
53 | 48 |
|
54 | | -## Configuring properties |
55 | | - |
56 | | -Format string, value and maximum number of decimal digits can be customized in SfNumericTextBox as below. |
57 | | - |
58 | | -{% highlight c# %} |
59 | | - |
60 | | -[C#] |
61 | | - |
62 | | -SfNumericTextBox numericTextBox = new SfNumericTextBox() |
63 | | -{ |
64 | | - |
65 | | - Value = 1000, |
66 | | - Watermark = "Principal Amount", |
67 | | - MaximumNumberDecimalDigits = 2, |
68 | | - FormatString = "c", |
69 | | - AllowNull = true, |
70 | | - CultureInfo = new NSLocale("en_us"), |
71 | | - PercentDisplayMode = SFNumericTextBoxPercentDisplayMode.Compute, |
72 | | -}; |
73 | | - |
74 | | -{% endhighlight %} |
75 | | - |
76 | | - |
| 49 | +Syncfusion has no liability for any damage or consequence that may arise by using or viewing the samples. The samples are for demonstrative purposes, and if you choose to use or access the samples, you agree to not hold Syncfusion liable, in any form, for any damage that is related to use, for accessing, or viewing the samples. By accessing, viewing, or seeing the samples, you acknowledge and agree Syncfusion’s samples will not allow you seek injunctive relief in any form for any claim related to the sample. If you do not agree to this, do not view, access, utilize, or otherwise do anything with Syncfusion’s samples. |
0 commit comments