Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all 91519 articles
Browse latest View live

BlinkID Implementation using Xamarin.Forms in an iOS Project.

$
0
0

I tried implementing the BlinkID using Xamarin.Forms. However when I run the a project from iOS, it generates an error.
I did set the Linker behavior to "Link All".
When I comment out the initialization code for BlinkID in FinishedLaunching it compiles.
Code below

public override bool FinishedLaunching(UIApplication app, NSDictionary options)
    {

        //Xamarin.Forms.DependencyService.Register<Microblink.Forms.iOS.MicroblinkScannerFactoryImplementation>();

        global::Xamarin.Forms.Forms.Init();


        LoadApplication(new App());

        return base.FinishedLaunching(app, options);
    }

It works well in Android but not in iOS.

The error message I get talks about MTouch, when I uncomment this line Xamarin.Forms.DependencyService.Register<Microblink.Forms.iOS.MicroblinkScannerFactoryImplementation>();
Any Ideas anyone?


Sensor quality of devices

$
0
0

I have been building an app that uses sensors and device orientation. On iPhone 6 the sensors (magnetometer, gyroscope and accelerometer) produces stabile results. On a newly bought Samsung Galaxy A20e api 28 - i'ts far too unstable too pass the requirements of the app. Prior to buying the phone I had trouble even finding an Android phone with the three mentioned sensors. My own Lenovo B api 24 and a samsung api 26 borrowed from a friend did not have them. Since iPhone 6 is from 2014 I thought more or less everyone was equipped with sufficient sensors today.

Currently it seems I can never release the app on Android

What is your experience when using the sensors on Android and iOS? How can I guarantee myself the app will work on most Android devices?

Why not update VS XF template solution?

$
0
0

Hi,

Is there anyone who knows why XF basic solution template in VS is not updated with new versions of XF nugets?

I want to learn if there is something I am missing here.

thanks for your time.

How to get relative offset after translation ?

$
0
0

Hi all,

I have been working on some animation and faced with the issue how to get relative offset after translation ?
I do the following translation:

await ComplexButton.MoveHorizontalAnimation(totalX, 250);

And after few steps I what to know the offset at which button located ?

How can i make a game in unity and run the game when i run xamarin.forms project?

$
0
0

Hi, I just came xamarin crash I want to make a game project that should be called from unity, how can I do it, help guide me

Google Map

$
0
0

Hi
What is the best tool to work with Google Maps. Which has good controls and no complexity

Cluster support

Shell generate Top Tapped Page in Code behind

$
0
0

Hi,

thanks for your help in advance. I am working on a Forms Shell App a few days now. My UI is data driven in a lot of aspects and what I am trying to accomplish ist a page that show multiple tabs on tob depending on the model it has.

In other words I try to accomplish the same layout as in the Shells Demo app:

<FlyoutItem Route="animals"
            Title="Animals"
            FlyoutDisplayOptions="AsSingleItem">
    <Tab Title="Domestic"
         Route="domestic"
         Icon="paw.png">
        <ShellContent Route="cats"
                      Style="{StaticResource DomesticShell}"
                      Title="Cats"
                      Icon="cat.png"
                      ContentTemplate="{DataTemplate views:CatsPage}" />
        <ShellContent Route="dogs"
                      Style="{StaticResource DomesticShell}"
                      Title="Dogs"
                      Icon="dog.png"
                      ContentTemplate="{DataTemplate views:DogsPage}" />
    </Tab>

But starting from an existing link in the FlyoutMenu. Like the level of the "Domestic" tab above, which when navigatet to creates those two or more Shell top tapped pages.

I am aware I could use a TappedPage as ShellContent, but TappedPages get styled a little different I was wondering if i could accomplish this with "native" Shell features.

I already tried something like:

ShellSection tab1 = new ShellSection
{
Title = "Tab1"
};
tab1.Items.Add(new ShellContent() { Title = "Test1", Content = new ContentPage() { Title = "Test1" } });
tab1.Items.Add(new ShellContent() { Title = "Test2", Content = new ContentPage() { Title = "Test2" } });

        var current = AppShell.Current.CurrentItem;
        current.Items.Add(tab1);

but this also adds another entry in the bottom tabs bar and the flyout menu as well, what i don't want.

Has someone an advice?

Share from Xamarin Essentials mysteriously quit working after updates, but only on iPad on iOS13.2

$
0
0

I updated my iPad to 13.2, updated to latest XCode on my mac, updated VS, updated to XF 4.3.

I know, not smart.

Everything appeared to work, until I tried the SHARE function of my app on iPad. The pop-over does not appear. An older version of my app works OK, and the new version works OK on my iPhone running 13.1.3.

I did try rolling back XF to what I was using (since it was easy), no help there.

Oh, and well there's another part to this mystery. To share multiple files, I wrote my own code using the iOS api, including creating an Activity Vew Controller (the pop-over). This doesn't work either.

Is there some kind of iPad settings or Info.plist thing I'm missing here? Got me very confused.


Backdoor to change my dependency injection

$
0
0

Hi, I'm creating UI tests to my app, I have a idea to create fake services with fixed data and inject it, have some way to indicate to prism when I want use specific implementation? I try create a conditional compilation symbol and compile my app for tests and recompile for release, but I want a use a rigth solution:

my code in this moment when I inject dependencies:

protected override void RegisterTypes(IContainerRegistry containerRegistry)
    {
    #if (UITESTS)
        containerRegistry.Register(typeof(AbstractLoginService), typeof(LoginServiceBackdoor));
        containerRegistry.Register(typeof(AbstractContatoService), typeof(ContatoServiceBackdoor));
        containerRegistry.Register(typeof(AbstractMapaService), typeof(MapaServiceBackdoor));
        containerRegistry.Register(typeof(AbstractEnvioComandoService), typeof(EnvioComandoServiceBackdoor));
        containerRegistry.Register(typeof(AbstractAlertaDisparadoService), typeof(AlertaDisparadoServiceBackdoor));
        containerRegistry.Register(typeof(AbstractVeiculoService), typeof(VeiculoServiceBackdoor));
    #else
        containerRegistry.Register(typeof(AbstractLoginService), typeof(LoginService));
        containerRegistry.Register(typeof(AbstractContatoService), typeof(ContatoService));
        containerRegistry.Register(typeof(AbstractMapaService), typeof(MapaService));
        containerRegistry.Register(typeof(AbstractEnvioComandoService), typeof(EnvioComandoService));
        containerRegistry.Register(typeof(AbstractAlertaDisparadoService), typeof(AlertaDisparadoService));
        containerRegistry.Register(typeof(AbstractVeiculoService), typeof(VeiculoService));
        containerRegistry.Register(typeof(AbstractClienteService), typeof(ClienteService));
        containerRegistry.Register(typeof(AbstractPercursosAnterioresService), typeof(PercursosAnterioresService));
        containerRegistry.Register(typeof(AbstractUsuarioService), typeof(UsuarioService));
        containerRegistry.Register(typeof(AbstractAncoragemService), typeof(AncoragemService));
        containerRegistry.Register(typeof(AbstractPerfilService), typeof(PerfilService));
        containerRegistry.Register(typeof(IResources), typeof(Resources));
    #endif
        containerRegistry.Register(typeof(AbstractParametroDAO), typeof(ParametroDAO));
        containerRegistry.RegisterForNavigation<NavigationPage>();
        containerRegistry.RegisterForNavigation<MainPage>();
        containerRegistry.RegisterForNavigation<Login>();
        containerRegistry.RegisterForNavigation<LeitorQR>();
        containerRegistry.RegisterForNavigation<Mapa>();
        containerRegistry.RegisterForNavigation<Views.Menu>();
        containerRegistry.RegisterForNavigation<Permissao>();
        containerRegistry.RegisterForNavigation<Contato>();
        containerRegistry.RegisterForNavigation<MasterDetail>();
        containerRegistry.RegisterForNavigation<EnvioComando>();
        containerRegistry.RegisterForNavigation<EnvioComandoVeiculo>();
        containerRegistry.RegisterForNavigation<AlertasDisparados>();
        containerRegistry.RegisterForNavigation<AlertaDisparadoSelecionado>();
        containerRegistry.RegisterForNavigation<RelatorioPercursosAnteriores>();
        containerRegistry.RegisterForNavigation<Ancoragem>();
        containerRegistry.RegisterForNavigation<ListaUsuarios>();
        containerRegistry.RegisterForNavigation<AlterarUsuario>();
        containerRegistry.RegisterForNavigation<ListaVeiculos>();
        containerRegistry.RegisterForNavigation<AlterarVeiculo>();
        containerRegistry.RegisterForNavigation<AlterarSenha>();
    }

Splash Screen Start up Work

$
0
0

I have added a splash screen to my app by following the Xamarin docs.
My question is, for xamarin forms, what is the typical start-up work that one does in the splash screen activity?

How to navigate from a ContentPage to a TabbedPage by clicking for example on a connection button?

$
0
0

I take the example of a login page. The login page is in a ContentPage and once the user is logged in I want to redirect him to a TabbedPage.

I want to update one property of an object inside ObservableCollection

$
0
0

Hi , I am struggling with a problem, my ObservableCollection doest refresh after change in code behind.

  private ObservableCollection<NotificationModel> _notifications = new ObservableCollection<NotificationModel>();

        public ObservableCollection<NotificationModel> Notifications
        {
            get => _notifications;
            set
            {
                _notifications = value;
                RaisePropertyChanged(nameof(Notifications));
            }
        }

this is my list,

After click on some item I Want to update the color of it

 var notification =  _notifications.First(x => x.Id == itemInfo.Id);
                notification.NotificationColor = "#FFFFFF";

but it doesnt work

i wanted to move the label position

$
0
0

hi , i am really new into xamarin.forms and i have an assignment based on CV displaying application. i have made the design already with workflow now i want to create my design in xamarin.forms. i am having a trouble with moving the label. i'll show you the design and i want to move the label to left side.
SKILLS text is what i want to move. can anybody help me with changing the position of label and can you please also help me in adding a new font to xamarin.forms. Thanks

Install Offline Simulator

$
0
0

How to download and install offline?

cannot be started Emulator

$
0
0

My simulator was healthy
Disabled all at once
How do I reset settings?

Starting emulator pixel_2_pie_9_0_-api_28 ...
C:\Program Files (x86)\Android\android-sdk\emulator\emulator.EXE -no-boot-anim -no-snapshot-load -avd pixel_2_pie_9_0
-api_28 -prop monodroid.avdname=pixel_2_pie_9_0-_api_28
1>Waiting for runtime checks to completeemulator: ERROR: x86 emulation currently requires hardware acceleration!
Please ensure Windows Hypervisor Platform (WHPX) is properly installed and usable.
CPU acceleration status: HAXM is not installed on this machine

Emulator pixel_2_pie_9_0_-_api_28 cannot be started.
Runtime checks completed
Build has been canceled.


ScrollView has height limitations built-in. Trying to insert very high image, it's being limited.

$
0
0

Hello!

I'm creating several pages with very long images that basically has long "landing page"-like information about products.

Here is my layout:

  <ContentPage.Content>
    <ScrollView
      >

        <Image
          HorizontalOptions="FillAndExpand"
          VerticalOptions="FillAndExpand"
                    x:DataType="pages:ProductImagePage"
                    Source="{Binding ImageFilename, Converter={StaticResource ImageResourceConverter}}"
                />     
    </ScrollView>
  </ContentPage.Content>

One image has size: 1280 × 10620
and it fits perfectly!

Another one has size:

960 × 12234

And it's not showing properly: ScrollView somehow has height limit that I was not aware of, and this high image has paddings on the sides (which means Image encountered height limit and to maintain aspect ratio it lowered width of the image)

How to remove this ScrollView limit?

TabbedPage - tabs on top iOS

$
0
0

Hi,

Is it possible without any 3rd party library to simply put the tabs of a TabbedPage on the top of the screen in iOS? (Like this library is doing: https://github.com/NAXAM/toptabbedpage-xamarin-forms)

Second question on the same topic is how can I change the color of the Tabs for iOS?

Best regards

Using with Facebook login in xamarin form

$
0
0

I Use Xamarin.Auth for login with Facebook Account, Facebook'sProfile photo Resolution is not clear in my App.

private void FacebookClicked(object sender)
{
PublicClass.LocalStorage.ClearAllStorage();
Helper.Constants.AuthSignUp = 1;
Helper.Settings.GeneralUserType = "";
DependencyService.Get().facebook();
}

**Dependency Service **

public class FacebookAuth : BaseViewModel, IFacebook
{
public void facebook()
{
var auth = new OAuth2Authenticator(
clientId: "1106049452932664",
scope: "email",
authorizeUrl: new System.Uri("https://m.facebook.com/dialog/oauth"),
redirectUrl: new System.Uri("https://www.facebook.com/connect/login_success.html"));

        auth.Completed += Auth_Completed;
        var ui = auth.GetUI((Activity)Forms.Context);
        ((Activity)Forms.Context).StartActivity(ui);
    }

    private async void Auth_Completed(object sender, AuthenticatorCompletedEventArgs e)
    {
        if (e.IsAuthenticated)
        {
            UserDialogs.Instance.ShowLoading();
            var request = new OAuth2Request(
                                            "GET",
                                            new System.Uri("https://graph.facebook.com/me?fields=email,name,first_name,last_name,gender,picture"),//https://graph.facebook.com/me?fields=name,picture,cover,birthday //https://graph.facebook.com/me?fields=email,name,first_name,last_name,gender,picture
                                            null,
                                            e.Account);

            var fbResponse = await request.GetResponseAsync();

            //var fbUserAccessToken = CrossFacebookClient.Current.ActiveToken;
            var obj = JObject.Parse(fbResponse.GetResponseText());
            var email = string.Empty;
            try
            {
                email = obj["email"].ToString().Replace("\"", "");
            }
            catch (Exception ex)
            {
                email = "psycho@gmail.com";
            }
            var FacebookAccessToken = e.Account.Properties["access_token"];
            var json = fbResponse.GetResponseText();
            var fbUser = JsonConvert.DeserializeObject<FacebookUserModel>(json);
            var name = fbUser.name;
            Helper.Constants.AuthUserEmail = email;
            Helper.Constants.AuthUserFName = fbUser.name;
            Helper.Constants.AuthUserLName = fbUser.last_name;
            Helper.Constants.AuthUserPhone = string.Empty;
            Helper.Constants.AuthUserProfilePic = fbUser.picture.data.url;
            Xamarin.Forms.MessagingCenter.Send<string>(Convert.ToString(Helper.Constants.isAuthLogin), "AuthLogin");
        }
    }
}

MasterDetail page drop shadow on detail

$
0
0

Is there anything that I need to do in iOS to get the drop shadow like in Android for the detail Window?

iOS doesn't seem to have that:

Emulator

$
0
0

Hi

I've been working without problems for a few days , but recently I run the simulator, but the name of the simulator doesn't appear in Visual Studio so I cant test the program. I Installed both the Visual Studio simulator and GenyMotion, but none appear in Visual Studio. I also sent her picture to you.

Is there anyone to guide?

Viewing all 91519 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>