Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all 204402 articles
Browse latest View live

How to get current ViewCell in ListView in OnItemAppearing

$
0
0

I am trying to fade in the cells for a ListView, but in order to do that I need to access the current cell being shown in OnItemAppearing. Anyone know how to do this?


Deep link not working when my app in closed

$
0
0

Hi,
I'm currently developing an app using Xamarin.forms. I want when user clicks on url inside text message, Open the app and go to specific page.
So, when the app is in background or opened all thing is Okay but when the app is closed, error message like "MyApp has stopped" appears!
please help me.
thanks.

No installed provisioning profiles match the installed iOS signing identities

$
0
0

I've looked at the previous discussions on this error and none of the previous solutions have helped.

I'm trying to run iOS code from Visual Studio to create an IPA file ( as in this ). When I try to build the code (step 7 of the Creating an IPA section on that page), I'm getting the error "No installed provisioning profiles match the installed iOS signing identities".

On developer.apple.com, I've created the App ID identifier, and created a Provisioning profile using the App ID, and then downloaded everything through Xcode on my Mac.

I've also tried running the code straight from Xamarin Studio, and I'm also getting the same "No installed provisioning profiles match the installed iOS signing identities"error.

Please advise how these issues can be resolved, so that I can build and run my code.

Integrate OAuth2 in Xamarin with WEB API

$
0
0

Hello,

I posted this in "Libraries, Components, and Plugins" and I think that was wrong.
I apologize in advance for any dumb questions or if I'm posting in the wrong location, im new to this forum.

I have a question regarding the integration between OAuth2Authenticator and Web API.
So currently I have a standard ASP.Net Web API running and I use POST/GET/PUT/DELETE methods from my Xamarin mobileapp to register users, change users etc.

I've managed to, with 0Auth2Authenticator, get a working Google and Facebook authentication. I get a access_token in return and that token is used to get profile information, works like a charm.

My only problem is HOW do i save that information in my Web API so that I can know who has registrered through social media login? I understand that some people don't want to save that information anywhere, but I would like to so I can save their settings and their activity.

I Understand that I should be using the /api/Account/RegisterExternal url of the WebAPI, but there are only tutorials, documentation and guides for that using a web application. and in thoose cases they use the customized URL combination of your web api webpage (eg: h t t p : / / WEBSITE.COM/api/Account/ExternalLogin?provider=Google&response_type=token&client_id=self&redirect_uri=REDIRECT_URL&state=SOME_STRANGE_ID_FROM_WEB_API)

Please could someone guide me to any information?

/Esse

Android 10 Emulator setup

$
0
0

Since Android 10 came out a few weeks ago, I've been trying to get an emulator working to no avail. No matter which system image I use it just fails to start. Emulators on lower API versions work fine.

I have the following things installed through the Android SDK Manager in VS2019:

  • Android SDK Platform 29, Version 3
  • Android SDK Tools, Version 26.1.1
  • Android SDK Platform-Tools, Version 29.0.4
  • Android SDK Build-Tools, Version 29.0.2
  • Android Emulator, Version 29.2.1
  • Android Support Repository, Version 47.0.0
  • Google Repository, Version 58
  • Google USB Driver, Version 11
  • Intel x86 Emulator Accelerator (HAXM installer), version 7.5.2

Any tips?

FCM Push Notification documentation outdated

$
0
0

Hello everyone, i'm trying to implement Push Notifications in a Xamarin.Forms Project which wouldn't be a hassle if the documentation wouldn't be outdated and all the functions deprecated. After long search i couldn't find any examples for how to implement it with the most recent Version. Is there any other resource except the source itself?

Inline C# inside XAML Tapped or Clicked

$
0
0

Hi,

Is it possible to have an inLine C# code inside XAML's Tapped or Clicked?

Foe example something like this:

Tapped="{ Navigation.PopAsync(); }"

Thanks,
Jassim

Why does Xamarin HybridWebview not fill the screen on Android?

$
0
0

Hello everyone,
I am new to Xamarin and I am currently building an application which features a Xamarin Forms HybridWebView, just the one introduced on the official docs. (Cannot post links yet)
So far so good, everything works perfectly, but the HybridWebView does not occupy all of the screen space available... As seen here (I blurred out the content), there is a white bar underneath, it is not coming from the Page, since I defined a background-color and if I add Margins/Paddings I can see the color. So the Webview does not get rendered properly?

Here is my Layout:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:d="http://xamarin.com/schemas/2014/forms/design"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:controls="clr-namespace:Project.Controls"
             mc:Ignorable="d"
             x:Class="Project.CustomWebViewPage"
             NavigationPage.HasNavigationBar="False"
             NavigationPage.HasBackButton="False"
             BackgroundColor="#313131"
             Padding="0">
    <ContentPage.Content>
        <StackLayout>
            <controls:HybridWebView 
            x:Name="hybridWebView" 
            BackgroundColor="#313131"
            Margin="0"
            />
        </StackLayout>
    </ContentPage.Content>
</ContentPage>

and here, I initialize it:

            var hybridWebView = new Controls.HybridWebView
            {
                Uri = App.GLOBAL_URL,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions = LayoutOptions.FillAndExpand
            };
            Padding = new Thickness(0, 0, 0, 0);
            Content = hybridWebView;

I have already tried:

  • Using Relative Layout
  • Using Absolute Layout
  • Setting Margin and Padding everywhere to 0
  • Using a Grid

Any help is very welcome, since I'm stuck with this for days..


Android 10 : Show Dialogbox error : Event handler

$
0
0

Hello,

Getting below error in android 10 emulator. In other, OS its working fine.

  • Error : Binary XML file line #51 in android:layout/alert_dialog_holo: Binary XML file line #51 in android:layout/alert_dialog_holo. inflating class com.android.internal.widget.DialogTitle

Code:

 public static void ShowDialogbox(Activity runningActivity, string title, string message, EventHandler<DialogClickEventArgs> onConfirm, string confirmButtonText = "Confirm", EventHandler<DialogClickEventArgs> declineHandler = null, string declineButtonText = "Cancel")
    {
        if (declineHandler == null) declineHandler = (sender, args) => { };
        var alertBuilder = new AlertDialog.Builder(runningActivity);
            alertBuilder.SetTitle(title).SetMessage(message)
            .SetCancelable(true)
            .SetPositiveButton(confirmButtonText, onConfirm)
            .SetNegativeButton(declineButtonText, declineHandler);

        var alert = alertBuilder.Create();

        alert.Show();
    }

Any help appreciated.

Thank you for stopping by.

Click button after some time

$
0
0

Hi,

I have set landing page as Mainpage and after some time span want to navigate to Login page.

Tried Task.Delay();

Auto logout after x minutes due to idle/inactivity in android

$
0
0

Is there way on how to auto logout the session of the user, when the user is idle or not clicking the app? Thank you.

Picking a Photo from the Picture Library

Submitting for TestFlight

$
0
0

I am working on updating an exist app(not written in xamarin) that is currently published and live. The new app is written in xamarin obviously, I have the app building and running on a test iphone and emulator sometimes. I can't find info on how to get my Xamarin app uploaded for TestFlight - trying to get it update for some beta testers to try it out. I am looking for the steps or if there is a guide/help I can follow. Using VS 2019 on windows.

Why can't i add new devices to the device selector in the Designer?

$
0
0

Hi,

i want to add another device to the device selector but there aren't any buttons to add or delete them. There is only a list with available devices (mainly Nexus and Pixel), Other Formfactors and Generic Devices.
I tried adding a device in Android Studio and it shows up there but as soon as i open Visual Studio, it renames %USERDATA%.android\devices.xml to devices.xml.old and my device is gone, even from android studio. That means that i have to rename it back to devices.xml because otherwise my Android Studio will be broken.

Is this supposed to happen like that?
How do i add new devices?

Cheers

Dynamic styles

$
0
0

Hello,
In my application I created a class which makes ui responsive based on Width height and dpi of the device. Currently I use binding to a lot of xaml element's width and height. I have a problem with slow loading therefore I would like to change this aproach. Responsivnes works 100% its just slow.

My question is: Is it possible to generate .css file which would take width heigh dpi at the startup and calculate new values. Then use this Css and avoid using bindings.

Example:

// this is static
body{
width:300px;
height:200px;
}

// this is dynamic
// widthModifier=0,5;
// heightModifier=0,3;
body{
width:300 * widthModifier; //150px
height:200 * heightModifier; //60px
}

If not .css then maybe xaml styles.

Have anybody tried to do this before?


Custom Control BindableProperty propertyChanged not Firing

$
0
0

Trying to set up a very simple custom control to handle alignment when using bullet points in a label. The issue is, the Spans passed into the custom control are not being recognized and the content isn't getting rendered (and the propertyChanged function isn't firing). What am I missing?

XAML:

<?xml version="1.0" encoding="UTF-8" ?>
<ContentView
    x:Class="Sample.Controls.BulletPointItem"
    xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:d="http://xamarin.com/schemas/2014/forms/design"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
    <ContentView.Content>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="10" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Label x:Name="BulletPoint" Text="&#x2022;" />
            <Label x:Name="LabelContent" Grid.Column="1" />
        </Grid>
    </ContentView.Content>
</ContentView>

Code-behind:

[ContentProperty(nameof(Spans))]
public partial class BulletPointItem : ContentView
{
    // todo add bindable props for bullet point size and color, or even which character to use as the bullet point!
    public static readonly BindableProperty SpansProperty =
        BindableProperty.Create(
            nameof(Spans),
            typeof(ObservableCollection<Span>),
            typeof(BulletPointItem),
            new ObservableCollection<Span>(),
            BindingMode.OneWay,
            propertyChanged: OnSpansChanged);

    public BulletPointItem()
    {
        InitializeComponent();
    }

    public ObservableCollection<Span> Spans
    {
        get => (ObservableCollection<Span>)GetValue(SpansProperty);
        set => SetValue(SpansProperty, value);
    }

    private static void OnSpansChanged(BindableObject bindable, object oldValue, object newValue)
    {
        var control = (BulletPointItem)bindable;
        var newSpansValue = (ObservableCollection<Span>)newValue;
        var formattedString = new FormattedString();

        if (control == null)
            return;

        if (newSpansValue == null || newSpansValue.Count == 0)
        {
            control.LabelContent.FormattedText = formattedString;
            return;
        }

        foreach (var span in newSpansValue)
        {
            formattedString.Spans.Add(span);
        }

        control.LabelContent.FormattedText = formattedString;
    }
}

Attempted Usage:

                            <controls:BulletPointItem>
                                <Span Text="Span 1." />
                                <Span FontAttributes="Italic" Text="Span 2." />
                            </controls:BulletPointItem>

Flip image first then go to next page

$
0
0

Found here how to flip a image vertical

https://xamgirl.com/plug-and-play-animations-in-xamarin-forms/

That works , but when i put it on my phone you don't see the flip en go's to the next page immediately ( or to fast i don't see the flip)

Can i change it so i see the flip til it is done en go then to the next page ? Maybe with a delay of some kind or execute and then .....

<Image x:Name="Firebaseimage" Source="Firebase" WidthRequest="40" HeightRequest="40"> <Image.Behaviors> <behaviors:ViewTappedButtonBehavior Command="{Binding OnLoginCommand}" AnimationType="FlipVertical"/> </Image.Behaviors> </Image>

And the Tap part

void OnTapGestureRecognizerTapped(object sender, EventArgs args) { var tapGestureRecognizer = new TapGestureRecognizer(); tapGestureRecognizer.Tapped += async (s, e) => { // handle the tap await Navigation.PushAsync(new Page1()); }; Firebaseimage.GestureRecognizers.Add(tapGestureRecognizer); }

Both Master and Detail not appearing on iOS 13 on the tablet.

$
0
0

Hello,

I got a problem with the MasterDetailView on the newest iOS 13. My app suddenly has problem when I updated my device to iOS 13 . I worked fine before. I made a small test project using the following code:

public App()
{
    InitializeComponent();

    var md = new MasterDetailPage()
    {
    Master = new Page() { Title = "Meester", BackgroundColor = Color.Red },
    Detail = new Page() { Title = "Leerling", BackgroundColor = Color.Green }
    };
    MainPage = md;
}

I still have the same problem.

Behaviour on Mobile:
View behaves as intended
The detail page that opens is Green.
When swiped from the left the detail page appears and this has the correct color Red.

Behaviour on Tablet
Bothe the master and detail keep being white and appear to have a size of -1, -1.
If i use contentpages the content of the pages is there in the object but just has no size.

I cannot find relevant information in the release notes of iOS 13. Does anybody know what the problem is?

iOS page covers status bar

$
0
0

What should I do to prevent the application cover the status bar area?
It covers the whole window and status icons are visible through top_grid on iPad 2 simulator


<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
                       xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                       x:Class="test_cs_mobile_xamarin.main_page">
   <StackLayout>
      <Frame x:Name="top_frame" HasShadow="true" OutlineColor="Green" Padding="5,5,5,5" VerticalOptions = "FillAndExpand">
         <ScrollView  x:Name="top_scroll_view" VerticalOptions = "FillAndExpand">
            <Grid x:Name="top_grid" VerticalOptions = "FillAndExpand">
               <Grid.Children>
               </Grid.Children>
            </Grid>
         </ScrollView>
      </Frame>
      <Frame x:Name="bottom_frame" HasShadow="true" OutlineColor="Green" Padding="5,5,5,5" VerticalOptions = "FillAndExpand">
         <ScrollView x:Name="bottom_scroll_view" VerticalOptions = "FillAndExpand">
            <Label  Text="..." XAlign="Start" YAlign="Start" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" x:Name="bottom_label" LineBreakMode="WordWrap" />
         </ScrollView>
      </Frame>
      <StackLayout x:Name="bottom_stack_layout" Orientation="Horizontal">
         <Button Text="Add 1" x:Name="button_1"></Button>
         <Button Text="Add 2" x:Name="button_2"></Button>
         <Button Text="http" x:Name="button_3"></Button>
         <Button Text="http 1" x:Name="button_4"></Button>
      </StackLayout>
   </StackLayout>

Custom tabbar Help

$
0
0

Hi I am trying to create a custom renderer on tabbed page from xamarin forms to execute the following layout
I am trying to have button - looking tabbar with menu icon on the same layer level.

Thanks!

Viewing all 204402 articles
Browse latest View live


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