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

Package for "Android 7.1 Nougat"

$
0
0

Error-

Severity Code Description Project File Line Suppression State
Error NU1202 Package Xamarin.Android.Support.v7.CardView 27.0.2.1 is not compatible with monoandroid71 (MonoAndroid,Version=v7.1). Package Xamarin.Android.Support.v7.CardView 27.0.2.1 supports: monoandroid81 (MonoAndroid,Version=v8.1) App3.Android C:\Users\manju\source\repos\App3\App3\App3.Android\App3.Android.csproj 1

Enviornment -
Visual Studio 2017
Android 7.1 Nougat
Virtualization Enabled
AMD processor A9

Which package need to be installed for the same?

Thanks,
Manjushree


How to take multiple pictures using camera in xamarin IOS?

$
0
0

i am using xamarin forms. In android i used intent for taking multiple pictures. But in IOS i know how to take single image in one click. I want to know how to implement multiple image capture using camera in IOS.

Sample ToDo - Downloaded - How do I execute

$
0
0

I have downloaded the sample ToDo List. There are many members in the folder. What member do I click to execute the sample?

TableSection Spacing Android

$
0
0

Hi
I have 1 TableView, 3 TableSections.
In iOS , the TableSections have a space between them, this space is not replicated in Android, how would I add the space in Android? without upsetting the iOS layout.

My Ideas:

  1. Add a blank, disabled Cell which only shows on Android.
  2. Use a grid, which only shows on Android
  3. Platform Specific XAML forms, if == Android, use XAML-A if ==iOS use XAML-B
  4. Custom renderer. If so, How?

I am open to other ideas or if someone could tell me the recommended way or, which of my ideas to pursue it would be much appreciated.

Token 01000007 Problem

$
0
0

Hi, this error always pop out: Unhandled Exception: System.TypeLoadException: Could not resolve type with token 01000007 from typeref (expected class 'Xamarin.Forms.Xaml.XamlResourceIdAttribute' in assembly 'Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null') occurred. Is there somebody who can help me to solve this problem? Thanks :smile:

How to select multiple images from gallery for android and IOS device and how to show it in the UI?

$
0
0

Same thread found here. But the answer is not complete.

Android part multiple image selection is working with that code, but didn't tell how to show the selected images in UI?

For IOS suggesting to install ELCImagePicker, but that Nuget is not available in Nuget store.

So anybody please suggest a solution for this feature?

How to access content (not embedded) images on Android / UWP

$
0
0

It really sucks! I just want to open the ditributed files, but I don't get it.
First of all I cannot get the correct paths to the files (drawable on Android and assemby/../ on UWP)

Thus.

1 (Android and UWP: How these files can be accessed. What's the best way to get the filepaths?
2. UWP: How do I obtain a StorageFile object from a file string path? (I need an IRandomAccessStream from that image files on UWP)?

Is there a way to get Firebase Push Messaging (FCM) to work with UWP?

$
0
0

I know there are ways to get Firebase FCM working with Android and iOS projects, but is there any way to get the firebase messaging to work with UWP?

Is using Azure the only way to successfully accomplish push notifications on all 3 platforms?


ActivityIndicator in Stacklayout show error with Invalid arguments

$
0
0

Dear All.
I am new to this forum and I don't know how to post question. I opened discusstion also for this and again I am asking this question.

Please help me in this regards. I get following error in .cs file when I add ActivityIndicator to Stacklayout.
It shows me red line with msg Argument 1: cannot not convert from .ActivityIndicator to Xamarin.Forms.Views.
Below is my code
ActivityIndicator ai = new ActivityIndicator() { IsVisible = true };
StackLayout sl = new StackLayout() {
Spacing = 0,
Margin = new Thickness(0, 0, 0, 0),
Padding = new Thickness(0, 0, 0, 0),
Children = { ai, periodgrid } // error here. Red line appears under ai
};
Thanks and best regards,

Replacing the bubbling effect when rendering views by fading effect?

$
0
0

Usually when views are rendered, they show up instantly by going from opacity = 0% to 100% in 0 milliseconds, I want to override this behavior so the transition occurs smoothly, like when images are rendered, or when navigating between ContentViews inside a ContentPage, so my first attempt is to create a behavior like this:

    public class FadingBehavior : Behavior<View>
    {
        protected override async void OnAttachedTo(View view)
        {
            //assuming that the view starts rendering from 0 opacity
            await view.FadeTo(1);
            base.OnAttachedTo(view);
        }
        protected override async void OnDetachingFrom(View view)
        {
            await view.FadeTo(0);
            base.OnDetachingFrom(view);
        }
    }

but it doesn't work!

BluetoothAdapter StartDiscovery performance

$
0
0

Hello.

I have a forms app with android as main target.
I´m scanning for Bluetooth devices (classic) using a dependency service and a broadcast receiver.
This works pretty well. Now I noticed, that when I call StartDiscovery android stutters for a moment.
In my debug window I see:
I/Choreographer( 8042): Skipped 285 frames! The application may be doing too much work on its main thread.

I tried to start "StartDiscovery" in a task even in a separate thread. Still the same performance impact.

Is there a way to avoid the stuttering?

Thanks for your help!

Xamarin Forms 3.4 Fast Renders

$
0
0

I would like to know if global::Xamarin.Forms.Forms.SetFlags("FastRenderers_Experimental"); is still needed in version 3.4 of forms to enable fast renders ? Thank you.

ViewExtenssion.TranslateTo animation not working android

$
0
0

public async Task SlideVerticaly(Xamarin.Forms.Grid grid, bool fromTop = true, uint duration = 1000)
{
if (grid != null)
{
var minAlpha = 0;
var maxAlpha = 1;
var minTransform = (fromTop ? -1 : 1) * App.HScreen;
var maxTransform = 0;

            grid.Opacity = minAlpha;
            await grid.TranslateTo(0, minTransform, 0, Easing.CubicInOut);
            grid.Opacity = maxAlpha;
            await grid.TranslateTo(0, maxTransform, duration, Easing.CubicInOut);
        }
    }

I has run IOS very fine but android to not working, every body can help me explain?

How to select multiple picture from galery using GMImagePicker in xamarin IOS?

$
0
0

Hi, I am following this blog for selecting multiple pictures from the gallery. For IOS I am Using GMImagePicker for selecting multiple pictures from the gallery.(In the blog suggesting elcimagepicker, but that is not available in Nuget Store now)

I go through the GMImagePicker usage part but didn't find how to add the selected images to List and pass that value in MessagingCenter(like the android implementation). In that usage part only telling about the picker settings. Anyone please give me any sample code for doing this feature?

Swipe to previous page and next page

$
0
0

Swipe like to Outlook in messages.
How this create?


Unable to discover the Xamarin.Forms Embedding nuget package

$
0
0

I am unable to discover the Xamarin.Forms Embedding nuget package.

I added a new source to my Nuget Manager: https://www.myget.org/F/xamarinforms-dev/api/v3/index.json

I also have pre-releases selected.

I have Xamarin.Forms 3.4 installed.

However, the package just doesn't show up.

The only items that show up are the following:

  • Xamarin.Forms Alias
  • Xamarin.FlexLayout.Engine.Yoga
  • Xamarin.Forms.Design

How to add a header to Android.Webkit.WebView when POSTing

$
0
0

Hi,

I've a custom renderer for Android, and although I can easily add custom headers when GETing, I can't seem to find how to do them when POSTing.

The line in question is the one marked // TODO:

            if (e.NewElement != null)
            {
                Element.PropertyChanged += (s, e1) =>
                {
                    if (e1.PropertyName == HybridWebView.UriProperty.PropertyName)
                    {
                        var headersDictionary = new System.Collections.Generic.Dictionary<string, string>();
                        headersDictionary.Add(StartupService.GetContextHeaderKey(), StartupService.GetContextHeaderValue(Models.UserAgentClientType.WebView));

                        Device.BeginInvokeOnMainThread(() =>
                        {
                            if (!string.IsNullOrEmpty(Element.PostData))
                            {
                                var uri = Element.Uri;

                                if (uri == null) return;

                                var postData = Element.PostData;

                                Element.PostData = null;

                                byte[] byteUtf8 = System.Text.Encoding.UTF8.GetBytes(postData);
                                var stringBase64 = Convert.ToBase64String(byteUtf8);
                                byte[] byte64 = Convert.FromBase64String(stringBase64);

                                Control.AddJavascriptInterface(new JSBridge(this), "jsBridge");

                                // TODO: Add custom header for Post scenario
                                Control.PostUrl(uri, byte64);
                            }
                            else
                            {
                                Control.AddJavascriptInterface(new JSBridge(this), "jsBridge");
                                Control.LoadUrl(Element.Uri, headersDictionary);
                            }
                        });
                    }
                };
            }

Any ideas?

Kind regards.

pre-release 4.0 - Shell usage

$
0
0

Hello everybody,

I start using XF 4.0 to test Shell with its navigation.
I'm trying to do few things (that would not be a problem with XF 3.X) and I'm hoping that someone already found it :D

1) Is there a way to TOTALY hide NavigationBar in some page ? eg. I'm creating a Login/Subscribe page and this one does not need a NavigationBar.

2) In page where I keep navigationBar, ContentPage.Content goes under NavigationBar. Is there a bool property to avoid it ?

I guess I can still try to use renderer to achieve it, but it would be more convenient with simple properties.

Best regards,

Cyril

Preventing the cursor from jumping to the end of an entry when modifying its text from code

$
0
0

I have a behavior attached to an entry which adds a separator character after every x digits. It works well, for the most part. But if I try to go to the middle of the entry and type, every time I type a digit, the cursor jumps to the end. The digit is added in the correct place and my separators are kept in the correct locations, but the cursor is moved to the end of the entry instead of where it should be, right after the last digit that was typed. Is there a way I can prevent this from happening (and keep the cursor where it is supposed to be) when my behavior changes the text contained in the entry?

Label - text align right

$
0
0

Hi,
I´m beginner. I need set priceLabel on the right. I tried property XAlign = TextAlignment.End and nothing :-(. Thanks for answer.

`public class DishCell: ViewCell
{
public static int count = 1;

    public DishCell ()
    {
        var menuLayout = CreateMenuLayout();
        var viewLayout = new StackLayout()
        {   
            Orientation = StackOrientation.Vertical,
            Children = { menuLayout }
        };

        View = viewLayout;
        count++;
    }

    static StackLayout CreateMenuLayout()
    {

        var weightLabel = new Label ()
        {   
            HorizontalOptions = LayoutOptions.End,
            TextColor = Color.Black,
            Font = Font.SystemFontOfSize(14)
        };
        weightLabel.SetBinding(Label.TextProperty, "Weight");

        var dishLabel = new Label
        {   
            WidthRequest = 140,
            HeightRequest = 40,
            TextColor = Color.Black,
            Font = Font.SystemFontOfSize(14)
        };
        dishLabel.SetBinding(Label.TextProperty, "Dish");

        var priceLabel = new Label()
        {
            HorizontalOptions = LayoutOptions.FillAndExpand,
            TextColor = Color.Black,
            Font = Font.BoldSystemFontOfSize(14),
            //XAlign = TextAlignment.End, //ovlivnuje zarovnani 

        };

        priceLabel.SetBinding (Label.TextProperty, "Price");

        var row = new StackLayout()
        {   
            Orientation = StackOrientation.Horizontal,
            Spacing = 20,
            Padding = new Thickness(10,10,10,10),
            Children = { weightLabel, dishLabel, priceLabel }
        };

        if(count % 2 == 0)
        {
            row.BackgroundColor = Color.White;
        }
        else 
        {
            row.BackgroundColor = Color.FromHex("ebebeb");
        }
        return row;
    }
}`
Viewing all 91519 articles
Browse latest View live


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