Closed Farshid1723 closed 4 years ago
MainPage.xaml
<?xml version="1.0" encoding="utf-8" ?> <ContentPage x:Class="FlexDemo.MainPage" xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:controls="clr-namespace:Flex.Controls;assembly=Flex" xmlns:d="http://xamarin.com/schemas/2014/forms/design" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d">
<StackLayout>
<!-- Place new controls here -->
<Label
HorizontalOptions="Center"
Text="Welcome to Xamarin.Forms!"
VerticalOptions="CenterAndExpand" />
<controls:FlexButton
x:Name="FlexBtn"
BackgroundColor="YellowGreen"
Clicked="FlexButton_OnClicked"
HeightRequest="200"
IsEnabled="True"
Text="Test Button"
VerticalOptions="Start" />
</StackLayout>
MainPage.xaml.cs
using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; using Xamarin.Forms;
namespace FlexDemo { // Learn more about making custom code visible in the Xamarin.Forms previewer // by visiting https://aka.ms/xamarinforms-previewer [DesignTimeVisible(false)] public partial class MainPage : ContentPage { public MainPage() { InitializeComponent(); }
private void FlexButton_OnClicked(object sender, EventArgs e)
{
_ = DisplayAlert("FlexDemo","This is from Flex Button","Ok");
}
}
}
This is all the code that is working on Android but not working on iOS.
Do you call FlexButton.Init();
as it is shown in the docs?
No, I didn't aware of that piece of code! Thanks, It solved my issue.
Hi, I have been busy with this issue since last two weeks and I couldn't find the issue root cause. flexButton sample project works well on all platforms, But whenever I have added it from Nugget into my solution, It just works well on Android Platform. I mean that all buttons are working the way excepted, But the same code doesn't work on iOS. As I checked several times, OnClick event and assigned ICommand properties didn't raised on iOS side, while they are working like charm on Android. Is there any issue from my code? Did I forget to do something for iOS project?