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

How to check the compatibility of macOS application in the lower version?

$
0
0

I am going to develop an application in Xamarin.Forms for macOS. I thought of supporting my application in OS X Mavericks and higher. I have macOS High Sierra in my macbook. Can someone tell me how to make sure that my application will run in lower versions like OS X Mavericks using my macbook itself?


problem when getting an image from the camera

$
0
0

Greetings, I'm trying to make an app on Android, IOS and UWP is about a classification of images and you can get the image in two ways one through the image galleries and one through the camera and I'm using the nuget package from Xam.Plugin. Media (3.1.3) when I try the app on android and use the button to get image by gallery no problem but when using the camera button the app closes and gives me a screen of break mode attached image and I gave it permissions to the androidmanifest of the camera, READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE and READ_INPUT_STATE but I still have the same error that I can do to solve this thanks appreciate the help

ListView or Label

$
0
0

Is it necessary to use ListView in order to assign value to a Label? I want to assign a value to a label which is coming from a Web API.
1. If I use ListView, it takes too much space but displays the value on the Label.
2. If I use only Label, value is not properly displayed on it. (Systems.Collections.Generic.List'1 instead of the data)

var foo = JsonConvert.DeserializeObject<List<MyClass>>(content);
Label_A.Text = foo.ToString();

Debug Xamarin Forms Library

$
0
0

I'm getting an error that I cannot create a sample app to recreate the bug. I know where the exception is occurring in the Xamarin Forms Android platform library. I need to put a breakpoint on one of the lines so I can see what is going wrong and document the bug for the Xamarin Forms team. But, I cannot successfully debug Xamarin Forms. What I tried doing is removing the NuGet packages and then manually adding the Xamarin Forms projects in to my solution (Xamarin.Forms.Core, Xamarin.Forms.) and then referencing these from my shared .NET Standard 2.0 library. Up to this point I can compile, but the issue I face is that the .xaml file don't generate code so I just get lots of compilation errors like

Severity Code Description Project File Line Suppression State
Error CS0115 'AccountsPage.OnAppearing()': no suitable method found to override Wallet C:\GitRepos\coins\src\Portfolio\Wallet\Pages\AccountsPage.xaml.cs 33 N/A
Error CS0115 'App.OnResume()': no suitable method found to override Wallet C:\GitRepos\coins\src\Portfolio\Wallet\App.xaml.cs 76 N/A
Error CS0115 'App.OnSleep()': no suitable method found to override Wallet C:\GitRepos\coins\src\Portfolio\Wallet\App.xaml.cs 71 N/A
Error CS0115 'App.OnStart()': no suitable method found to override Wallet C:\GitRepos\coins\src\Portfolio\Wallet\App.xaml.cs 66 N/A

These errors come up because Visual Studio isn't generating any code.

So, how can I debug Xamarin Forms? How can I get Visual Studio to realize that it needs to run a custom tool on .xaml files to generate the code?

Is there a tutorial anywhere to step through XF code?

OnSleep/OnResume not working on iOS app

$
0
0

It doesn't appear that OnSleep()/OnResume() is working for my iOS app. OnStart() seems to work fine, and all 3 lifecycle methods are working on Android version of the app. I'm on v1.4.1. The code is pretty straightforward, but I'll post it anyways:

    public App()
    {
        var disclaimerPage = new DisclaimerPage();
        disclaimerPage.AcceptedDisclaimer += HandleAcceptedDisclaimer;
        MainPage = disclaimerPage;
    }

    private void HandleAcceptedDisclaimer(object sender, EventArgs e)
    {
        MainPage = new NavigationPage(new MainPage());
    }

    protected override void OnStart()
    {
        Debug.WriteLine("***Starting up the app***");
    }

    protected override void OnSleep()
    {
        // Handle when your app sleeps
        Debug.WriteLine("***Going to OnSleep***");
    }

    protected override void OnResume()
    {
        // Handle when your app resumes
        Debug.WriteLine("***Resuming operation***");
    }

iOS 5s vs iOS6 Which is better for build Xamarin forms project?

$
0
0

I am developing Cross platform application,I have tested my app on android, but now I have to test my project on iOS.So which one should I buy? iPhone 5s or 6s?

Xam.Forms.Maps - Zoom level or Similar

$
0
0

I am developing a system for IOS with maps using the "Xamarin.Forms.Maps".

This system contains massive pins (~ 34k), the problem is that the performance is extremely slow when Zoom out which visualize all. When zooming in and points decrease over the viewing area performance improves.

Question, it is possible as well as on Google Maps to get the points only appear when you are near the well far.

f you do not have it, someone suggests an idea to improve performance?

Can't Load Sqlite file in IOS

$
0
0

I have issue with sqlite in ios it's worked in android but in ios tha application crashed any help?


Error: “com.facebook.sdk.login error 308” in Xamarin.Form

$
0
0

I am using Visual Studio 2017. I am trying to connect with Facebook using following code by not able to connect. Can any body please suggest me what I missing? I have tried many solution but none of them work.

public void LogInToFacebook()
{
    if (AccessToken.CurrentAccessToken == null)
    {
        ObtainNewToken(LogInToFacebook);
        return;
    }
}

Getting Error: The operation couldn’t be completed. (com.facebook.sdk.login error 308.)
private readonly string[] permissions = { "public_profile", "email", "user_birthday", "user_photos" };
private void ObtainNewToken(Action callback)
{
var login = new LoginManager();

        login.LogInWithReadPermissions(permissions, null, (r, e) =>
        {
            if (e == null && !r.IsCancelled)
                callback?.Invoke();
            else
                HandleError(e?.LocalizedDescription);
        });
    }

info.plist: Facebook Related content

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSExceptionDomains</key>
    <dict>
        <key>myapp.com</key>
        <dict>
            <key>NSTemporaryExceptionMinimumTLSVersion</key>
            <string>TLSv1.0</string>
            <key>NSTemporaryExceptionRequiresForwardSecrecy</key>
            <false/>
            <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
            <true/>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <true/>
        </dict>
        <key>facebook.com</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
            <false/>
        </dict>
        <key>fbcdn.net</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
            <false/>
        </dict>
        <key>akamaihd.net</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
            <false/>
        </dict>
    </dict>
</dict>

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>fbapi</string>
    <string>fbapi20130214</string>
    <string>fbapi20130410</string>
    <string>fbapi20130702</string>
    <string>fbapi20131010</string>
    <string>fbapi20131219</string>
    <string>fbapi20140410</string>
    <string>fbapi20140116</string>
    <string>fbapi20150313</string>
    <string>fbapi20150629</string>
    <string>fbauth</string>
    <string>fbauth2</string>
    <string>fb-messenger-api20140430</string>
    <string>fb-messenger-api</string>
    <string>fbshareextension</string>
</array>
<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>fb90000000000</string>
        </array>
        <key>CFBundleURLName</key>
        <string>facebook</string>
    </dict>
</array>
<key>FacebookAppID</key>
<string>8000666666666</string>
<key>FacebookDisplayName</key>
<string>MyApp – Test</string>

Cocossharp in Xamarin forms

$
0
0

i have searched over the internet to learn about cocossharp game development, how the layer,objects,collision... works and other.

but i cant able to find ,i can see only the examples , in that example itself i can see lot of calculations and it was confusing me a lot..

please help me to learn about cocossharp

Native views and VS2017 intellisense not working

$
0
0

Today I found out about Native Views, awesome!
However, my intellisense is not working for this. It works fine except for inside the native xaml.

My xmlns declarations:

xmlns:ios="clr-namespace:UIKit;assembly=Xamarin.iOS;targetPlatform=iOS"
xmlns:androidWidget="clr-namespace:Android.Widget;assembly=Mono.Android;targetPlatform=Android"
xmlns:formsAndroid="clr-namespace:Xamarin.Forms;assembly=Xamarin.Forms.Platform.Android;targetPlatform=Android"
xmlns:win="clr-namespace:Windows.UI.Xaml.Controls;assembly=Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime;targetPlatform=Windows"

My xaml controls:

<ios:UISwitch On="{Binding Path=IsSwitchOn, Mode=TwoWay, UpdateSourceEventName=ValueChanged}"
                    OnTintColor="{x:Static ios:UIColor.Red}"
                    ThumbTintColor="{x:Static ios:UIColor.Blue}" />
<androidWidget:Switch x:Arguments="{x:Static formsAndroid:Forms.Context}"
                            Checked="{Binding Path=IsSwitchOn, Mode=TwoWay, UpdateSourceEventName=CheckedChange}"
                            Text="Enable Entry?" />
<win:ToggleSwitch Header="Enable Entry?"
                        OffContent="No"
                        OnContent="Yes"
                        IsOn="{Binding IsSwitchOn, Mode=TwoWay, UpdateSourceEventName=Toggled}" />

Intellisense stops after <ios: and the other platforms. It seems it can see the xmlns but not what's inside.

When I run the app it works great, I get different controls for each platform.
Im using VS2017, 15.3.4 and tested Xamarin.Forms 2.3.4.270 / 2.4.0.269-pre2 (nuget).

Anyone else experiencing this? Or is this just not supported?

Picker Renderer Affecting Behavior Without Any Additional Code

$
0
0

I was trying to apply a custom render to Picker when I realized the renderer affects the behavior of the Picker on Android platforms even without any additional code, i.e.

public class CustomPickerRenderer : PickerRenderer
{
    public CustomPickerRenderer(Context context) : base(context)
    {
    }
}

Without the renderer, the picker displays a full screen of options:

After renderer is applied, it looks like this:

Why is this the case and how can I apply a custom renderer while preserving the original behavior?

Set height in Toolbar xamarin froms

$
0
0

Hi i want to define Height in Toolbar, how hi can do this.

This is my code:

ContentPage.ToolbarItems >

<ToolbarItem Text="Botão 1" Clicked="OnClickButtonOne" Order="Secondary" />
<ToolbarItem Text="Botão 2" Clicked="OnClickButtonTwo" Order="Secondary" />
<ToolbarItem Text="Botão 3" Clicked="OnClickButtonThree" Order="Primary" Icon="cloud.png" />
<ToolbarItem Text="Botão 3" Clicked="OnClickButtonThree" Order="Primary" Icon="edit.png" />
<ToolbarItem Text="Botão 3" Clicked="OnClickButtonThree" Order="Primary" Icon="incomingmail" />
<ToolbarItem Text="Botão 3" Clicked="OnClickButtonThree" Order="Primary" Icon="list.png" />
<ToolbarItem Text="Botão 3" Clicked="OnClickButtonThree" Order="Primary" Icon="replayarrow.png" />
<ToolbarItem Text="Botão 3" Clicked="OnClickButtonThree" Order="Primary" Icon="settings.png" />
<ToolbarItem Text="Botão 3" Clicked="OnClickButtonThree" Order="Primary" Icon="signal.png" />
<ToolbarItem Text="Botão 3" Clicked="OnClickButtonThree" Order="Primary" Icon="search.png" />

</ContentPage.ToolbarItems>

Joining a bunch of controls

$
0
0

Sorry if this is a very basic question, but I don't know how is the name of the control or if I have to do a view, a subpage or a layout.

The point is that I have a bunch of controls (an entry, a delete button for the entry, and a listview) and variables that I want to encapsulate as a new control or something, to use with other pages once or more times. But I don't know what kind of element should I use to do it. If you could point me in the right way, I will do my researchs.

Also, I have to bind the listview with a list that can be one of the different models I have in my app, with different types of variables in it. Am I wrong or this is the time when I have to use a converter?

Thank you.

Silent remove of Page in Navigation Stack

$
0
0

Is there a way to move from one page to another but remove the last page I was on from the navigation stack.

For example

Page 1 > Page 2 > Page 3

As I move from Page 2 to Page 3, remove Page 2 from the navigation stack so when I go back it goes to page 1.

I know I can manually remove things from the navigation stack but it causes all kinds of weird animations when going back. Also if I do a Pop then a Push, it shows the animation on screen which I don't want.

So I am wondering if there is a way to remove it from the Stack silently, with no onscreen animations or quick flashes of the page etc visible to the user?


Real Time Vehicle Tracking Using Xamarin Forms

$
0
0

I am working on a task to track a vehicle (Cab)from mobile app which is to be built in Xamarin forms. Planning to Use GeoLocator plugin. Any ideas and suggestion how should i proceed.

I wish to show the vehicle moving on the map route when the user is actually tracking the ride.

How to get the best routes for a particular destination?

A device is installed in the vehicle which keeps sending the GPS Location.

Ideas and Suggestions are welcome.

How to edit and show code in Xamarin Forms

$
0
0

Hello
I would like to know how can we show Code in formatted way like we do in web pages and how to create a text area for editing code in Xamarin Forms, I am new to xamarin and xamarin forms
Thanks

SnackBar Issue

$
0
0

Hi , in my Xamarin forms app, when the user clicks on delete icon , I am showing a snackbar with the provision of undoing the deleted item. Now if I make the app go in sleep(background), change the language of device through settings , open the app and now when I click on delete button snackbar is not displayed.

Same is working fine for IOS and Xamarin android.

Any help is appreciated. TIA

how to disable the space occupied by the activity indicator in xamarin forms Mobile application?

$
0
0

how to disable the space occupied by the activity indicator in xamarin forms Mobile application?

Consuming REST services

$
0
0

What is the best method for consuming REST services which are locally deployed? I am specifically having issues with utilizing HTTPS for iOS. When calling the web service from iOS (the iPhoneSimlator), I receive a "TrustFailure" web exception. I think this is because the certificate used is self-signed (it's not secure because I am using my internal IP address and the certificate is issued for localhost) when using IIS Express. Does this mean I need to "publish" my API to IIS (or Azure) and use a valid certificate in order to consume the service? This seems like a lot of work for development, especially since I am creating the REST service and mobile application at the same time.

My development environment is:

I have reviewed this and this, but neither really touch on this issue. Any advice on a streamlined workflow would be much appreciated.

Viewing all 58056 articles
Browse latest View live


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