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

How to show iphone calander in Xamarin Forms

$
0
0

I want open the default phone calendar for iPhone, from Xamarin Forms. Can we able to do that? Could not find any reference links could anyone help me on it?

Thanks in advance


Your app uses or references the following non-public APIs.

$
0
0

How can I solve this error?

Guideline 2.5.1 - Performance - Software Requirements

Your app uses or references the following non-public APIs:

PrivateFrameworks/OpenCL.framework (_clEnqueueTask), PrivateFrameworks/OpenCL.framework (_clGetPlatformInfo)

The use of non-public APIs is not permitted on the App Store because it can lead to a poor user experience should these APIs change.

Continuing to use or conceal non-public APIs in future submissions of this app may result in the termination of your Apple Developer account, as well as removal of all associated apps from the App Store.

Next Steps

If you are using third-party libraries, please update to the most recent version of those libraries. If you do not have access to the libraries' source, you may be able to search the compiled binary using the "strings" or "otool" command line tools. The "strings" tool can output a list of the methods that the library calls and "otool -ov" will output the Objective-C class structures and their defined methods. These tools can help you narrow down where the problematic code resides. You could also use the "nm" tool to verify if any third-party libraries are calling these APIs.

Loading an Image from a Resource in xaml

$
0
0

I have a resource called biglogo.png added via the Resource menu and now it's in the Resources folder of my project.

I want to use it via xaml but neither

nor

seem to work. Is there a straightforward way to make it work?

Entry.Focus() Not Working For Android

$
0
0

Hello,

Currently, I am using this setup to set focus to an Entry:

protected override void OnAppearing()
{
    base.OnAppearing();

    Entry emailEntry = this.FindByName<Entry>("emailEntry");
    emailEntry.Focus();
}

The Entry is part of a StackLayout. So on the iOS emulator it focuses on the entry and brings up a keyboard. On the Android emulator, however, it just sets focus to the entry, but does not bring up the keyboard. I've noticed other people having the same issues in the forums, but couldn't find an answer or workaround. Are there currently any plans to fix this, and what is a workaround I can use?

Thanks

ViewCell and TranslateTo animation

$
0
0
Hi,

I would like to consume the Appearing event of a ViewCell inside a Listview so that when an element is being loaded, I can do some little nice animations such as loading it from left to right inside the Listview.

I can use TranslateTo, Fade and Scale for other Views such as Image but I am really struggling to do the same for a ViewCell inside a Listview.

Thanks

Email Validation

$
0
0

I have to check email validation or particular domain

E.g. abc@xyz.com

All email should be of xyz domain.

Call listview.ScrollTo method from MVVM

$
0
0

Hello guys, Im trying to realize a ScrollTo to a specific position of my listview.
Since Im using MVVM approach, in myxaml I haven't x:Name = myListview but I just have the ItemsSource = "{Binding myList}"
I noticed that the scrollTo is not a bindable property (you have to do listview.scrollTo in codebehind usually), so how can I scrollTo a specific element from MVVM if I don't have a reference to the listview Object directly?
Thanks!

How to upload and preview PDF document in xamarin forms?

$
0
0

I am currently developing a mobile app in iOS & Android using XF and i am trying to allow the user to be able to upload a PDF document.

The flow of the app will be when user click on a button, it will bring them to a file manager page where they can select the document they want and after selecting the document, it will show a preview of the pdf at the app and when user click submit, the file will be uploaded to a server.


VS2017 15.9 & XF 3.4 - can't build the project

$
0
0

Hi,

I am trying to build a XF project but getting the following weird error:

3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2129,5): error MSB4018: The "LinkAssemblies" task failed unexpectedly.
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2129,5): error MSB4018: Mono.Linker.MarkException: Error processing method: 'System.Void WiFiManager.MainPage::InitializeComponent()' in assembly: 'WiFiManager.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void Xamarin.Forms.Xaml.Internals.SimpleValueTargetProvider::.ctor(System.Object[],System.Object,Xamarin.Forms.Internals.INameScope)

The full list is available here:
https://pastebin.com/k4hTDVTQ

What am I doing wrong?

Better way to select multiple photos from gallery in Android and iOS

$
0
0

Hi, i'm trying to find a solution to select multiples photos in Xamarin in both platforms, can be two separated nugets or something like that.
I tried GmImagePicker, but it simply don't open the images selector view controller, i followed the GitHub tutorial.
Something i can use? Thanks.

Using xamarin language to test software element on appcenter

$
0
0

Currently I am using xamarin to test a software running on HTC Android Phone 6.0.1. As for the numberpicker input, I have a problem, that is not working on the Set button to save the month. The ways I used to affect the set button:

app.tap̣ (x => x.Id ("button1"));
With button1 is the id of the Set nut

app.tap (x => x.Text ("Set"));
Set is the value of the button's text property

app.TapCoordinates (230,400)
with 230 and 400 are the x and y values of the Set button
but all do not working
What should I do next? Thank you all for your comments

Icons have poor clarity in Xamarin forms UWP project

$
0
0

I am using 24x24 pixels icons in my xamarin forms UWP project, but not getting good clarity when it comes in UI. For Android, I am using 4 set of icons for different devices and 3 set for IOS. How many sets of icons are needed for UWP and what is the resolution for those icons?

Long label with word wrap doesn't seem to auto calculate height correctly

$
0
0

I have a label within a flex layout that doesnt seem to adjust to the new height of a wrapped label. Is this a bug or am I missing something?

This is within a stack layout

There is still another full sentence after this that wont show up unless I manually enter a HeightRequest larger

Cannot call Other Layout from Another Layout by Button Click

$
0
0

Sir,
I am very new in xamarin. I have three layout. 1) main.axml, 2) layLogIn.axml, 3) layRegistration.axml and have three Activity file 1) mailActivity.cs 2) layLogInActivity.cs and 3) ActivityRegistration.cs

When App start main.axml Layout start first, then from main layout I call layLogIn layout by button click. Then, when I try to call layRegistration layout from layLogIn by Button click, it not working.

Codes:

mailActivity.cs

namespace BCCSJr
{
    [Activity(Label = "BCCS Junior", MainLauncher = true, Icon = "@drawable/icon")]
    public class MainActivity : Activity
    {
        //public static void SetHasBackButton();
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView (Resource.Layout.Main);

            Button btnLogIn = FindViewById<Button>(Resource.Id.btnLogIn);
            btnLogIn.Click += btnLogIn_Click;

            Button btnRegistration = FindViewById<Button>(Resource.Id.btnRegistration);
            btnRegistration.Click += btnRegistration_Click;

        }

        private void btnLogIn_Click(object sender, EventArgs e)
        {

            SetContentView(Resource.Layout.layLogIn);

        }

        private void btnRegistration_Click(object sender, EventArgs e)
        {

            SetContentView(Resource.Layout.layRegistration);
        }

    }
}

Codes for layLogInActivity.cs

namespace BCCSJr
{
    [Activity(Label = "layLogIn", MainLauncher = false, Icon = "@drawable/icon")]
    public class layLogInActivity : Activity
    {
        protected override void OnCreate(Bundle OnSaveInstanceState)
        {
            base.OnCreate(OnSaveInstanceState);
            SetContentView(Resource.Layout.layLogIn);

            Button btnLogInActivity = FindViewById<Button>(Resource.Id.btnLogInActivity);
            //btnLogInActivity.Click += btnLogInActivity_Click;

            //try to call layRegistration.axml layout
        btnLogInActivity.Click += delegate
                {
                    //txtLogError.Text = "You are in Log In page";
                    SetContentView(Resource.Layout.layRegistration);

                };


            // Create your application here
        }

        private void btnLogInActivity_Click(object sender, EventArgs e)
            {
        SetContentView(Resource.Layout.layRegistration);
        }


    }
}

Image Performance in Xamarin forms

$
0
0

Hi Everyone. I'm working with an Application which deals with a lot of Images from Server. Sometimes (I thought due to less memory but it's the same in all devices) the images are not showing and getting disappear from the view. I can't understand why it's happening. I have gone through Glidex but unable to install it due to Package conflictions. If anyone knows how to increase the performance of the app which deals with images, please help me.

Any help is appreciated.


Show/Hide Grid Row (works on UWP, not Android)

$
0
0

I have a bound listview with a grid in the itemtemplate. The grid row's height is bound to a data property (of type GridLength) on the bound item . I can change the bound height value to anything other than zero, and it all works as expected. The row resizes to the new height. But once I set it to zero, and the row disappears as expected, even after changing the value to non-zero again, the row does not re-appear on Android (emulator. I have tried emulator version 7.1 and also 8.1 and updated Visual Studio 2017 to v. 15.9.1). On UWP it works fine. The rows re-appear as expected.

Here is a sample with two rows. When the "Hide" button is clicked, the first row height is set to zero, the second row height is set to 1. When the "Show" button is clicked, both rows are reset to their default height value. The second row resizes as expected, but the first row does not. The first row stays hidden and can not be shown again no matter what value the height is set to.

Any ideas?

<br /><?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="too young to post links"
             xmlns:x="too young to post links"
             xmlns:local="clr-namespace:ShowHideRow"
             x:Class="ShowHideRow.MainPage">

    <StackLayout>
        <Button x:Name="BtnHide" Clicked="BtnHide_Clicked" Text="Hide" />
        <Button x:Name="BtnShow" Clicked="BtnShow_Clicked" Text="Show" />
        <ListView ItemsSource="{Binding BindableThings}" HasUnevenRows="True">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <ViewCell>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="{Binding BoundHeight}" />
                            </Grid.RowDefinitions>
                            <Label Grid.Row="0"  Text="{Binding TestString}" />
                        </Grid>
                    </ViewCell>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>
    </StackLayout>

</ContentPage>


    public partial class MainPage : ContentPage
    {
        public MainPage()
        {
            InitializeComponent();
            this.BindingContext = this;
        }

        public List<BindableThing> BindableThings { get; set; } = new List<BindableThing>()
        {
            new BindableThing() { TestString = new String ('*', 200)  },
            new BindableThing() { TestString = new String ('!', 200)  },
        };

        private void BtnHide_Clicked(object sender, EventArgs e)
        {
            BindableThings[0].BoundHeight = new GridLength(0);
            BindableThings[1].BoundHeight = new GridLength(1);
        }

        private void BtnShow_Clicked(object sender, EventArgs e)
        {
            BindableThings[0].BoundHeight = new GridLength(50);
            BindableThings[1].BoundHeight = new GridLength(50);
        }
    }


    public class BindableBase : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        public void propchg(string propname)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(propname));
        }
    }

    public class BindableThing : BindableBase
    {
        public string TestString { set; get; }

        GridLength _BoundHeight = new GridLength(50);
        public GridLength BoundHeight {
            get => _BoundHeight;
            set {
                _BoundHeight = value;
                propchg(nameof(BoundHeight));
            }
        }
    }

What are the considerations to officially support webassembly/HTML5?

$
0
0

Considering the dawn of Xamarin Forms 4.X and the latest news on Connect() (open sourcing all relevant MS UI frameworks, but not accepting pull requests for any cross platform initiative) I think it's fair to ask these questions:

Are there any considerations to support webassembly/HTML5 as an official platform for Xamarin Forms?

  • If so, could you please elaborate on these considerations?
  • If no, could you please share the reasons which prevented MS from making XF available on webassembly/HTML5?

Note: I'm well aware of Ooui. However, with deep respect for the author and without any offense nor intention to discount his work I have to state:

  • there was not much activity on that project recently
  • after all that project is not 'backed up' by MS
    Hence, I could not consider it being at the same level as any potential, official support of Xamarin Forms for webassemblyHTML5

Google Maps with Xamarin.Forms - Get Directions

$
0
0

How can I get the directions using the Google API (Map) for Xamarin.Forms?

Translating view in the ViewCell in ListView applied to both Onscreen & Offscreen items(view) ?

$
0
0

I am trying to implement translateX animation for view in Listview's ViewCell ,but it also effect off screen views.

I know the the problem is because of recycling Views {https://stackoverflow.com/a/14108676/8020754}

The amazing thing is that why only with animations ,while other property changing does not effect off screen items.

May be my implementation is correct that is below ;

        var MainList = new ListView
                {
                    HasUnevenRows=true,
                    ItemsSource = new List<Models.Directory> {
                    new Models.Directory {Icon="folder.png",Name="sdssa",size="343",IsFile=false },
                    new Models.Directory {Icon="folder.png",Name="s3ssa",size="343",IsFile=false },
                    new Models.Directory {Icon="folder.png",Name="sds4sa",size="343",IsFile=false },
                    new Models.Directory {Icon="folder.png",Name="sdssfa",size="343",IsFile=false },
                    new Models.Directory {Icon="folder.png",Name="sdss5sa",size="343",IsFile=false },
                    new Models.Directory {Icon="folder.png",Name="sdsdfsa",size="343",IsFile=false },
                    new Models.Directory {Icon="folder.png",Name="sdsksa",size="343",IsFile=false },
                    new Models.Directory {Icon="folder.png",Name="sdsssa",size="343",IsFile=false },
                    new Models.Directory {Icon="folder.png",Name="sdssga",size="343",IsFile=false },
                    new Models.Directory {Icon="folder.png",Name="sdfssa",size="343",IsFile=false },
                    new Models.Directory {Icon="folder.png",Name="sdsksa",size="343",IsFile=false },
                    new Models.Directory {Icon="folder.png",Name="sdsisa",size="343",IsFile=false },
                    new Models.Directory {Icon="folder.png",Name="sdiossa",size="343",IsFile=false },
                    new Models.Directory {Icon="folder.png",Name="sdssya",size="343",IsFile=false },
                    new Models.Directory {Icon="folder.png",Name="sdstysa",size="343",IsFile=false },
                    new Models.Directory {Icon="folder.png",Name="sdssga",size="343",IsFile=false },
                    new Models.Directory {Icon="folder.png",Name="sddgfssa",size="343",IsFile=false },
                    new Models.Directory {Icon="folder.png",Name="sdss3a",size="343",IsFile=false },
                    new Models.Directory {Icon="folder.png",Name="sds6sa",size="343",IsFile=false },
                    new Models.Directory {Icon="folder.png",Name="sds5sa",size="343",IsFile=false },
                    new Models.Directory {Icon="folder.png",Name="sdss54a",size="343",IsFile=false },
                    new Models.Directory {Icon="folder.png",Name="sdss4a",size="343",IsFile=false },
                    new Models.Directory {Icon="folder.png",Name="sdss34a",size="343",IsFile=false },
                    new Models.Directory {Icon="folder.png",Name="sds3sa",size="343",IsFile=false },
                    new Models.Directory {Icon="folder.png",Name="sdss4a",size="343",IsFile=false },
                    new Models.Directory {Icon="folder.png",Name="sdgssa",size="343",IsFile=false },
                    new Models.Directory {Icon="folder.png",Name="spdshsa",size="343",IsFile=false },},
                    ItemTemplate=new DataTemplate(() => {
                    var ic = new Image { };
                    ic.SetBinding(Image.SourceProperty, "Icon");
                    var name = new Label { TextColor=Color.Black ,HorizontalOptions=LayoutOptions.StartAndExpand};
                    name.SetBinding(Label.TextProperty, "Name");
                    var size = new Label { };
                    size.SetBinding(Label.TextProperty, "size");
                    size.SetBinding(Label.IsVisibleProperty, "IsFile");
                    var AnimeButton = new Button { };
                    AnimeButton.SetBinding(Button.TextProperty, "Name");

                    AnimeButton.Clicked+=(s,e)=>{
                (s as Button).TranslationX = -100; 
                //(s as Button).TranslateTo(-100,0,100,Easing.Linear);
            };
                    var stk = new StackLayout
                    {
                        Orientation = StackOrientation.Horizontal,
                        Children = { ic, name, size ,AnimeButton}
                    };

                    return new ViewCell { View=stk};
                })
            };
            Content = MainList;

Error during release build

$
0
0

Unerwarteter Fehler bei der LinkAssemblies-Aufgabe.
Mono.Linker.MarkException: Error processing method: 'Android.Views.ScaleGestureDetector Xamarin.Forms.Platform.Android.GestureManager::InitializeScaleDetector()' in assembly: 'Xamarin.Forms.Platform.Android.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void Android.Support.V4.View.ScaleGestureDetectorCompat::SetQuickScaleEnabled(Android.Views.ScaleGestureDetector,System.Boolean)
bei Mono.Linker.Steps.MarkStep.HandleUnresolvedMethod(MethodReference reference)
bei Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference)
bei Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction)
bei Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
bei Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
bei Mono.Linker.Steps.MarkStep.ProcessQueue()
--- Ende der internen Ausnahmestapelüberwachung ---
bei Mono.Linker.Steps.MarkStep.ProcessQueue()
bei Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue()
bei Mono.Linker.Steps.MarkStep.Process()
bei MonoDroid.Tuner.MonoDroidMarkStep.Process(LinkContext context)
bei Mono.Linker.Pipeline.Process(LinkContext context)
bei MonoDroid.Tuner.Linker.Process(LinkerOptions options, ILogger logger, LinkContext& context)
bei Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
bei Xamarin.Android.Tasks.LinkAssemblies.Execute()
bei Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
bei Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() Retailer.Android

Hello,
my code shows this error trying to build a release version.

Can someone explain me what
s happend?

Viewing all 91519 articles
Browse latest View live


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