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

How to stop the activity indicator after click on button /navigate to the next page

$
0
0

Hello,
I have the login form on which i have added the activity indicator ,I want to work the my application like when I enter the credentials activity indicator should start & when i click on login button it should stop.

But now in my application activity indicator is continously running.

In XAML file below code is there

In .CS file below code is there

please give me suggestion to how to solve.


FirstVisibleItemIndex and LastVisibleItemIndex is wrong in CollectionView's Scrolled Event's in iOS

$
0
0

Description

When a Xamarin.Form's CollectionView Scrolled events fired in ios, Event's ItemsViewScrolledEventArgs.FirstVisibleItemIndex and ItemsViewScrolledEventArgs.LastVisibleItemIndex is wrong. It works fine in Android but provide -2 for the FirstVisibleItemIndex then it's actual visible item index and +2 for the LastVisibleItemIndex. On Initial Phase it provide correct value for FirstVisibleItemIndex (e.g; is 0) but +2 for the LastVisibleItemIndex. once you scoll to up it start providing incorrect index for FirstVisibleItemIndex as well.

Here I provided a sample application which shows the numbers in collection view starting with 0 and can be between 30 to 50 randomly. At the bottom of the page, it has two labels which show the first and last visible item index respectively.

Steps to Reproduce

Run the application iOS device or simulator.
Scroll up 0 and 1 until the 2 becomes the first visible item and note the First Visible Item Index, It is still 0 even if first two items are not displayed anymore (Bug, it should be 2). Also, note the Last Visible Item Index, It will be +2 then the last item displayed on the screen. (e.g; it will be 20 if Last visible item is 18).

Expected Behavior

The FirstVisibleItemIndex and LastVisibleItemIndex should be provide correct result.

Actual Behavior

The FirstVisibleItemIndex is -2 then the actual visible item and +2 for the LastVisibleItemIndex then the actually displayed item index.

Here I am attaching the screenshots (from iPhone 11 pro max) and sample code.

How to create an Expandable ListView?

$
0
0

Currently, I have a listview with an "itemtapped" event for each item, which allows to navigate to other views depending on which item I tap. However, I want to "group" these and divide in sections (a listview containing listviews). I've been doing some digging on google and other forums, but can't really make this work. Thanks!

ListView.xaml.cs

public ObservableCollection listaA { get; set; }

public ListView()
{
InitializeComponent();

        listaA= new ObservableCollection<Categorias>();
        listaA.Add(new Categorias { Seccion = "1", Subseccion = "question1's detail", QuizType = Type.type1 });
        listaA.Add(new Categorias { Seccion = "2", Subseccion = "question2's detail", QuizType = Type.type2 });
        listaA.Add(new Categorias { Seccion = "3", Subseccion = "question3's detail", QuizType = Type.type3 });
        listaA.Add(new Categorias { Seccion = "4", Subseccion = "question3's detail", QuizType = Type.type4 });

private async void MainListView_ItemTapped(object sender, ItemTappedEventArgs e)
{

        Categorias model = (Categorias)e.Item;

        if (model.QuizType == type1)
        {
            await Navigation.PushAsync(new TYPE1());

//....

ListView.xaml

            <ListView.ItemTemplate>
                <DataTemplate>
                    <ViewCell>
                        <StackLayout Padding="20" HorizontalOptions="Fill" >
                            <Label HorizontalOptions="Center" VerticalOptions="CenterAndExpand" TextColor="Black" FontSize="25" Text="{Binding Seccion}"/>
                        </StackLayout>
                    </ViewCell>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>

searchbar CursorDrawable (Cursor color ).

$
0
0

How to change searchbar CursorDrawable (Cursor color ) in xamarin forms?

How to use pagination in collectionview?

$
0
0

Can a collectionview be use with pagination?

first load the fistpage data and when scroll the collectionview load more data?

Unterminated string. Expected delimiter

$
0
0

When I calling Tcp request and when we call this "var responseModel = JsonConvert.DeserializeObject(str);" then it return error:

Unterminated string. Expected delimiter.

how to open whatsapp from IOS app to a specific number xamarin form

$
0
0

i need to know how i can open whatsapp from my app to a specific number? for android its working fine but dont know if its work with ios here is my code for android

try
            {
                Device.OpenUri(new Uri("whatsapp://send?phone=+678115361041"));

            }
            catch (Exception ex)
            {
                await DisplayAlert("Not Installed", "Whatsapp Not Installed", "ok");

                await DisplayAlert("",ex.Message,"ok");
            }

need to know how to do for IOS in xamarin form

Auto Scrolling to bottom of the items in Collection view

$
0
0

Hi,

I am using CollectionView,
Scenario:
I have list of items under CollectionView named as (Page1), When i click on any item in page 1 , "Page 2" is opened.
After entering user details in page 2. I click on Save button
When I click Save button, navigating to page 1. Here I need auto scrolling functionality to bottom all items.
I tried with scroll_collectionView.ScrollTo(lastindex, position:ScrollToPosition.End, true); //Not working

can anyone tell me how to auto scroll in collection view.?


carousel image in collectionview

$
0
0

hi
how can use carouselimage in collectionview with other cell like label

To dismiss the keyboard upon entering the last OTP digit

$
0
0

Hello Guys,

I am working on a concept which has a OTP screen.
The requirement is to dismiss the keyboard automatically upon entering the last digit of the 6 digit OTP number.

Here is what I have done till now -

if (lastOTPInputEntry.Value != string.Empty)
{
    lastOTPInputEntry.Unfocus();
}

The I have an EntryRenderer which overrides this method -

protected override void OnFocusChangeRequested(object sender, VisualElement.FocusRequestArgs e). 
{ 
   if (Control != null). 
   {    
        if (e.Focus)
        {
             Control.RequestFocus();
        }
        else
        {
            Control.ClearFocus();
        }
    }
}

Control is a FormsEditText
But somehow the keyboard does not dismiss.
What am I doing wrong here .. ?

Multiple overlaying profile pictures

$
0
0

Hello Everybody,

I was wondering how you would create such a CollectionView where
you have multiple overlapping profile pictures such as the following example (found it on Stackoverflow)

Thanks for your ideas!

How To Migrate To XamarinBuildDownloadAndroidAarLibrary?

$
0
0

How do you migrate from XamarinBuildDownloadRestoreAssemblyAar to XamarinBuildDownloadAndroidAarLibrary? I am not able to build & debug my Xamarin Android app and this warning is being given:

"XamarinBuildDownloadRestoreAssemblyAar is no longer supported. If your build is failing, revert to an older Xamarin.Build.Download version, or migrate your packages to use the new XamarinBuildDownloadAndroidAarLibrary ItemGroup. If your build is succeeding it is safe to ignore this warning."

I haven't found the documentation to do so.

How to use tap-gesture and long-press effect at same time in xamarin.forms?

$
0
0

I need to use TapGestureRecognizer and Long Press effect at Grid at the same time. I implemented the tap-gesture and long-press on Grid and its working fine in ios. But in android, only tap-gesture is working. But if I remove tap-gesture then long-press effect start working.

How can I make it so that both can work at the same time?

How to use Navigation.InsertPageBefore in a ViewModel class in xamarin forms?

$
0
0

Hi

I was using the below code in my previous application to remove login page from the stack once the user has successfully logged in.

                                        var supervisor = new Supervisor();
                                        Navigation.InsertPageBefore(supervisor, this);
                                        Navigation.PopAsync();
                                        btnLogin.IsEnabled = true;
                                        Spinner.IsEnabled = false;

I want to do the same in a viewmodel class where I am not able to use "this" keyword as it represents a page. So is there any other way in which I can accomplish my task.
Any help will be greatly appreciated.

Regards

Deep zoom on huge image

$
0
0

Hello,

I'm trying to display a huge image on my application (50000x2048)
I use SkiaSharp with the SKCanvasView and when I want to draw the image with the corresponding size of canvas, I have the following exception : "Canvas: trying to draw too large(263700000bytes) bitmap"

I seems that the size limit depends on the device used (available memory I guess ?).
I have opened this image with the android picture viewer and it displays it by doing a sort of deep zoom on the image. Bad quality when I zoom and the image is reconstucted in full quality after a few time.

Is someone know how to implement it or if there's a component able to do it ?
(And for my knowledge, how to know the size limit of the canvas ? )

Thanks for any help.

Mike


Xamarin.Forms: Upload a file on Onedrive

$
0
0

Hello,
I followed Microsoft's exemple [https://docs.microsoft.com/en-us/graph/tutorials/xamarin?tutorial-step=1ttp://] to build a connection to Azure into my app using Graph APIs, and it works: the connection is fine, and I can retrieve user data.
However, I can't find a way to upload a file to Onedrive.
I am using the following code:

string path = Path.Combine("/data/data/com.ApriSoft.memocourses/files/Backup", "MemoCourses.db3");
byte[] data = System.IO.File.ReadAllBytes(path);
Stream stream = new MemoryStream(data);
// Line that updates the existing file             
await App.GraphClient.Me
              .Drive
              .Root
              .ItemWithPath("/Backup/MemoCourses.db3")
              .Content
              .Request()
              .PutAsync<DriveItem>(stream);

But after a few minutes I got the following error:
Authentication Error
Code: GeneralException
Message: An error occured sending the request.

Is my code incorrect?
Please help me, I would like to finish my app. Thank you very much.

            ;

To view this content install and set up a web browsing app

$
0
0

HI i archived my app and published it on internal sharing in google play store . But suddenly I am getting this error , Continuously

"To view this content install and set up a web browsing app"

PLease help .

Floating action button at the bottom of the xaml page

$
0
0

How to add a Floating Action Button At the Bottom of the page...Please anyone suggest me how to do it?

Connect Xamarin App with Web app using random code pairing

$
0
0

I have a requirement.I am developing a Xamarin TV app which will receive notification from ASP.Net application.

If i want to add a new device to web application,

1.first open the TV App

2.generate a random code like XGYUIT on TV app (Something like google Chromecast pairing screen)

3.Input this Code code in Add Device screen in web application

4.Once its confirmed(paired),i should start receiving contents and notification for that particular Device Id

How to do this in Xamarin?

Expiry date

$
0
0

Please I have Developed a Xamarin.forms application using C# code. Now I need to apply Expiry date, that means I need to create trial version for the 1st time user, and The application must close after the expire date.

Thanks in Advance.

Viewing all 79144 articles
Browse latest View live