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

To what extent does Xamarin.Forms.Maps handle requestion Location permissions?

$
0
0

Hi,

(Poke @JamesMontemagno )

My questions are:

  1. Does Xamarin.Forms.Maps handle requesting permissions on Android 6+ when using Xamarin.Forms.Maps.Map.IsShowingUser?
    If yes, from which version?
    If no, why does it (seem to) handle it on iOS?
  2. Should we handle requesting permissions ourselves before using built-in Xamarin.Forms.Maps.Map.IsShowingUser? (I have no problem with this idea if it's clear that we have to)
  3. Is there a changelog for Xamarin.Forms.Maps? On NuGet, it's the same changelog as Xamarin.Forms

My question is related to this question: Can't get location

When developing my application, I mainly run it on iPhone simulator because I find it to be the fastest way to work. It seemed to me that Xamarin.Forms.Maps.Map handles Location permissions when using IsShowingUser so I thought it would be the same on Android but only realized today that it was not the case.

So I wonder if any version fixes that (I'm still stuck at 1.5.1) or if we should handle this ourselves.

Regards,


How to implements Like & Dislike button

$
0
0

hey guys i was wondering if you could help me to implement my project im facing a problem in my two buttons in my listview that if i click "like" i want to change the "dislike" button . the problem i'm facing that i can't get access to the other button since i can't call the X:name from my listview .

my view "like" button:

<Button.Triggers>



</Button.Triggers>

public async void SetLike (object sender, EventArgs e)
{
**Here i want to change the other button property **
}

MasterDetail page wrong behavior

$
0
0

Hi! I'm starting a new app using MasterDetail page. When I try the code on iOS behaves properly but on android shows a navigation bar that should not be there. I've downloaded the Evolve 2013 app sample and even there is not working ok. Does anyone has the same issue? how did you solve it?

image  image

Adding web reference is not generating the expected reference.cs file. (Begin and End function)

$
0
0

I'm working with xamarin studio on mac. A webserviced referenced in the original app has 2 functions and when i peak inside the auto-generated reference.cs file I notice a couple of other functions to allow async calls have been generated i.e. BeginWhateverFunctionNameIsCalled and EndWhateverFunctionNameIsCalled. i chosed .NET 2.0 webservices..

My problem is that I've created a new xamarin forms app and added the same web references but the Begin and End functions are not generated in my reference.cs proxy class. Anyone know whats going on?

SearchBar focus?

XAML or C#?

$
0
0

Hi,

What are the pros and cons in using XAML for layouts in forms or c#? I want to know what is actually best for performance. I've seen lots of discussions in the forums about this but I'm still unsure.

Thanks

Z-Index in a Grid View

$
0
0

Hey there, I'm having an issue concerning the z-index of certain cells in a grid. Forgive me if z-index is not the correct term but it's the only one I'm aware of. The following images demonstrate my problem :

Here's the grid normally. There's 3 cells each containing a StackLayout which arranges the image and text. I have an event that will move the contents of an individual cell using TranslateTo upon a left or right swipe.

Here I am swiping the middle cell to the right (please ignore the black box) as you can see the 2nd cell is sliding under the 3rd cell, eventually becoming not visible. This is my desired behaviour.

Here I am swiping the 3rd cell to the left. As you can see, the 3rd cell is sliding over the 2nd cell. I imagine this is because the 2nd cell was added before the 3rd when generated. This is not desired behaviour. All cells must slide either under each other (or offscreen if applicable) when swiped left or right

I assumed RaiseChild could help me, but it seems to have no effect. Am I using it incorrectly?

/*Grid that contains StackLayout*/
/*StackLayout that is being translated*/
g.RaiseChild (sl);

The only other solution I can imagine - assuming that the order of children determines z-index - is to re-add the children on every swipe, making sure that the one being swiped is added last. Any other suggestions?

Extending Xamarin Forms for WPF

$
0
0

Currently Xamarin Forms is not compatible with WPF . Looking at the source code in xamarin forms , it looks it is possible to extend the framework for WPF. I am trying to extend that. Is there anyone here who can provide me with some help? It would be good if someone has a very good WPF application experience.


capture the action back button cell

$
0
0

hi guys, how do I capture the action button to return the phone?
eg when you click the back button and the phone is the app 's home page display an alert asking if you really want to exit the app .

ListView ItemTapped returns wrong item [iOS]

$
0
0

Hello

I've a problem in ListView and the ItemTapped event. When handling it, I get a wrong item on iOS. This is always the case when I fast(!) tap two different items in list. You can easy reproduce it easy when you for example use Debug.WriteLine(myitem.SomeIdentifier) in the ItemTapped event. You will see that you will always get the first tapped item.
Anyone else has the same problem and a fix for it, or is it a (known) bug? (I'm working with version 2.2.0.31, also tried 2.2.0.45, problem still exists)
This is very ugly and it works on Android, but not for iOS (at least not in simulator).

Thank you for your help.

how to know version of Xamarin Forms

$
0
0

I just installed community edition of the latest Visual studio with Xamarin. When I click Help->About I can see in the installed products that Xamarin is 4.0.x version. How do I know which version of Xamarin Forms am I using? And are Xamarin Forms upgraded independently? I was assuming that everything is from one installer.

HttpClient upload report with PostAsync

$
0
0

Hey,

I created my own version of my imgur uploader. And now, i want to get my upload progress. I can use ModernHttpClient if you want, because i have small difficulties to make my progress report.

This is my code:

using (var client = new HttpClient(new NativeMessageHandler()))
{
    SetHeaders(client);

    var base64Image = ImageToBase64(imageStream);

    var response = await client.PostAsync(new Uri(BaseUrl + "image"), new StringContent(base64Image));

    if (response.IsSuccessStatusCode)
    {
        var content = await response.Content.ReadAsStringAsync();

        var imageObj = JsonConvert.DeserializeObject<ImgurRootObject<ImgurModel>>(content);

        return imageObj.Data;
    }

    return null;
}

Thank you for your help.

Guidance on making application more responsive on Android devices

$
0
0

Hi,
I have an Xamarin.Forms application and would like to make it more responsive, because when I run it on several Android emulators it looks different depending on resolutions setted on each device. Any suggestions? I mostly use Grid Layout.

Best,
Tomasz Kowalczyk

GPS getPositionAsync (get current location) Implementation isn't working?

$
0
0

I'm using this plugin https://blog.xamarin.com/geolocation-for-ios-android-and-windows-made-easy/

The app DO NOT CRASHES.. It just leaves the method after this line:
var position = await locator.GetPositionAsync (-1);

I call updateLocation() method in the OnStart of the application, and updateLocation() calls getCurrentLocation() which is inside my ViewModel class:

`

 protected override void OnStart ()
  {
    this.updateLocation ();
  }

public async Task updateLocation()
{
    ViewModels.ListViewModel lvm = new ViewModels.ListViewModel ();
    lvm.Logs = new System.Collections.ObjectModel.ObservableCollection<ViewModels.Log> ();     //Logs is binding to ItemsSource of a listView
    await lvm.getCurrentLocation ();
}

`

`

 public class ListViewModel : BaseViewModel
    {

        Position position;
        public Position Position {
            get {
                return position;
            }
            set {
                position = value;
            }
        }

        Log log;
        public Log Log {
            get {
                return log;
            }
            set {
                log = value;
            }
        }

        public ObservableCollection<Log> Logs {
            get;
            set;
        }

        public ListViewModel ()
        {
            this.Logs = new ObservableCollection<Log> ();
        }

        public async Task getCurrentLocation ()
        {
            var locator = CrossGeolocator.Current;
            locator.DesiredAccuracy = 50;
            var position = await locator.GetPositionAsync (-1);   //

            this.Position = position;
            this.Log = new Log {
                Latitude = this.Position.Latitude,
                Longitude = this.Position.Longitude,
                DateHour = this.Position.Timestamp
            };

            this.Log.Title = "Latitude: " + log.Latitude.ToString () + " \n" + "Longitude: " + log.Longitude.ToString ();
            this.Log.Description = "às " + log.DataHora;
            this.Logs.Add (this.Log);
        }
    }

`

ListView Scroll to selection problem

$
0
0

Hello
Attached is a project that is basically only a page with a long simple list .
What I am trying to do is to change the seleciton on the list using arraw keys , which is working .
The problem is that if the selection went further down the selection we be after the visible point and the list does not scroll down or up .
I have tried to use ScrollTo method to scroll to the selected item , but it turns ugly and it keeps the selected item either always on top or always on bottom .
Can someone help me please ?


Xamarin.Forms.Maps White Screen

$
0
0

Hello Fellow Xamarin Developers

I am having a problem (Once again :( )

I am trying to show a simple map on an Android application but It the map tiles never load only google label and zoom in and out buttons

Main Activity

public class MainActivity : AndroidActivity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);

        Xamarin.Forms.Forms.Init(this, bundle);

        Xamarin.FormsMaps.Init(this,bundle);

        SetPage(App.GetMainPage());
    }
}

the code for the maps View is as follows

public MainView()
{
var map = new Map(
MapSpan.FromCenterAndRadius(
new Position(37, -122), Distance.FromMiles(0.3)))
{
IsShowingUser = true,
HeightRequest = 100,
WidthRequest = 960,
VerticalOptions = LayoutOptions.FillAndExpand
};
var stack = new StackLayout { Spacing = 0 };
stack.Children.Add(map);
Content = stack;

    }

Sir Manifest the google key value has been ommited


















This isnt my first time with Maps using Xamarin but it is with Forms

if anyone can point out what Im doing wrong or if Im missing a step please do tell

Xamarin.Forms Anti-Patterns/No no's

$
0
0

I'm just trying to gather some opinions/experiences around Xamarin.Forms problems, from the wisdom of this forum.

If you've been using Xamarin.Forms for a while what lessons have you learnt? What have you found that are anti-patterns/No no's?

C# on your iPad / iPhone

$
0
0

Just wanted you all to know that I just released my latest app built with Xamarin.Forms. The app is a development tool for C# on the iPad/iPhone using Roslyn to give you full code completion, compiling of code and debugging. It's possible to build both UIKit and Xamarin.Forms programs with the tool on the device.

https://itunes.apple.com/us/app/c-coder/id1116411677?ls=1&mt=8

How Pull To Refresh should work ?

$
0
0

Hello,

I try to use PullToRefresh on my listview but it doesn't work.
I have this settings on my listview :
IsPullToRefreshEnabled="True"
IsRefreshing="{Binding IsBusy}"
RefreshCommand="{Binding RefreshCommand}"

In the RefreshCommand I set IsBusy at True at the beginning and at False in finally.

But When I try to Scroll on my listview, it doesn't move.

Just one precision, my listview has not enought cells to fill my screen, so there is no scroll effect.

Thank,

Xamarin forms iOS Navigation stack error

$
0
0

Xamarin.Forms.Platform.iOS.NavigationRenderer.GetAppearedOrDisappearedTask NullReferenceExceptionObject

https://bugzilla.xamarin.com/show_bug.cgi?id=38731

This has been reported by many developers perviously.
After that Xamarin has fixed it.

But,
This is happening again in Xamarin Forms 2.2.0.45
Tested environment iOS 9.3

Xamarin Team,
Please fix this asap.

at Xamarin.Forms.Platform.iOS.NavigationRenderer.GetAppearedOrDisappearedTask (Xamarin.Forms.Page page) [0x00018] in :0
at Xamarin.Forms.Platform.iOS.NavigationRenderer.RemoveViewControllers (Boolean animated) [0x00055] in :0
at Xamarin.Forms.Platform.iOS.NavigationRenderer.PopViewController (Boolean animated) [0x00000] in :0
at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, IntPtr principal, IntPtr delegate) [0x00005] in /Users/builder/data/lanes/3234/d8bedd03/source/maccore/src/UIKit/UIApplication.cs:77
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/3234/d8bedd03/source/maccore/src/UIKit/UIApplication.cs:61
at Brusselslife.iOS.Application.Main (System.String[] args) [0x00008] in /Users/hiranpeiris/Documents/Xamarin/brusselslife_mobile/iOS/Main.cs:17

Viewing all 58056 articles
Browse latest View live


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