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

I can not execute the sample of Hello, Android: Quickstart or Multiscreen

$
0
0

I have downloaded but Hello Android: Quickstart and Multiscreen. When I attempt to execute phoneword.sin I get message ONE OR MORE PROJECTS IN THESOLUTION WERE NOT LOADED CORRECTED. I get the same message from but the Quickstart and the Multiscreen Deep Dive. What must I do to get around this problem?


Showing DISABLE_XAML_GENERATED_BINDING_DEBUG_OUTPUT when loading a page

$
0
0

Redirecting to App.g.i.cs when loading a page in xamarin UWP. Code control comes to the following if block.

#if DEBUG && !DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION
        UnhandledException += (sender, e) =>
        {
            if (global::System.Diagnostics.Debugger.IsAttached) global::System.Diagnostics.Debugger.Break();
        };
#endif

If I mouse over the e showing {Windows.UI.Xaml.UnhandledExceptionEventArgs}

I am not understanding what is the problem? Is this related to some error in XAML? This issue is only on the windows app, Android and IOS apps parts are working fine.

Thanks in advance :)

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?

jarsigner error java.lang.runtimeexception keystore load keystore was tampered with, or password wa

$
0
0

Getting the title error when publishing android APK in Xamarin Forms. I am trying to do this from Mac visual studio.

Screenshot:

I am sure my password is correct. Is there any other reason for this issue? What is keystore tampering?

Please help me.

Bottom navigation in all the screens

$
0
0

Hi
I have 4 items in bottom navigation ,so i want these Bottom navigation in all the screens.For example even if i click on Hmaburger menu items the bottom navigation should be there..How to do this..please help

Thanks

ListView Binding to ObservableCollection changes all values

$
0
0

Hi :)

I'm trying to create a page where I have a list of informations (each row should contain from, to, what and where). I also want to be able to add or remove rows.
Therefore I made a ListView with a DataTemplate fitting to what I need.
I created a DataType containing the four values I need for a row. Then I made an ObservableCollection of this DataType where I put all my rows in.
I'm binding this ObservableCollection as ItemsSource for my ListView and in my DataTemplate I'm binding the values from my Datatype.

When I run my application everything displays as I want it to, also adding/removing rows works. When I edit a field, e.g. the 'fromTime' (TimePicker), the value in this field changes - fine so far.
But now I'm facing a problem I can't get rid of:
It may look nice on the UI, but when I'm looking at the data, there's something wrong..
I have a seperate class for my data containing the ObservableCollection and a standart value (for adding new rows).
When I change a value, no matter in which row, all values of this type in my data-class change! (All of these values in the observableCollection and also the one in my standart value.)

Seems to me like I need to bind to these values inside the observableCollection at the right index.. But I'm new to Xamarin so I don't get it. I tried to find a solution for this in forums, but couldn't find anyone facing the same problem.
Now I hope you can help me as I'm starting to despair :s ;)


Here's my code:

XAML layout:

Text on top (inside ContentPage), because it's not rendered here ^^
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:xObjectMobile"
x:Class="xObjectMobile.PensumDetailPage"
BindingContext="local:Pensum"

<ContentPage.Content>
    <ListView x:Name="p_lstView" RowHeight="160" SeparatorColor="DodgerBlue" ItemsSource="{Binding pensumFields}">
        <ListView.Header>
            <StackLayout Orientation="Horizontal" HorizontalOptions="Fill">
                <Label x:Name="p_lblPensumDetailPage" Text="Pensum" HorizontalOptions="Center" Margin="20" FontSize="Large"/>
                <DatePicker x:Name="p_dpPensumDate" HorizontalOptions="EndAndExpand" Date="{Binding selectedDate}" IsEnabled="False"/>
            </StackLayout>
        </ListView.Header>
        <ListView.ItemTemplate>
            <DataTemplate>
                <ViewCell>
                    <StackLayout Orientation="Vertical" HorizontalOptions="Fill" Margin="15,0,15,0">
                        <StackLayout Orientation="Horizontal">
                            <Label x:Name="p_lblFrom" Text="Von" Margin="0,10,0,0"/>
                            <TimePicker x:Name="p_tpFromTimePensum" HorizontalOptions="FillAndExpand" Margin="0,15,0,0"/>
                            <Label x:Name="p_lblTo" Text="Bis" Margin="0,10,0,0"/>
                            <TimePicker x:Name="p_tpToTimePensum" HorizontalOptions="FillAndExpand" Time="{Binding toTime}" Margin="0,15,0,0"/>
                        </StackLayout>
                        <StackLayout Orientation="Horizontal">
                            <Label x:Name="p_lblType" Text="Art"/>
                            <Picker x:Name="p_picType" HorizontalOptions="FillAndExpand" SelectedIndex="{Binding selectedType}" ItemsSource="{x:Static local:Pensum.pensumTypes}"/>
                        </StackLayout>
                        <StackLayout Orientation="Horizontal">
                            <Label x:Name="p_lblLocation" Text="Ort"/>
                            <Entry x:Name="p_entLocation" HorizontalOptions="FillAndExpand" Text="{Binding location}"/>
                        </StackLayout>
                    </StackLayout>
                </ViewCell>
            </DataTemplate>
        </ListView.ItemTemplate>
        <ListView.Footer>
            <StackLayout Orientation="Horizontal" HeightRequest="60" VerticalOptions="End">
                <Image x:Name="p_btnAddField" Source="@drawable/plus.png" Margin="5">
                    <Image.GestureRecognizers>
                        <TapGestureRecognizer
                            Tapped="p_btnAddField_Clicked"/>
                    </Image.GestureRecognizers>
                </Image>
                <Image x:Name="p_btnRemoveField" Source="@drawable/minus.png" Margin="5">
                    <Image.GestureRecognizers>
                        <TapGestureRecognizer
                            Tapped="p_btnRemoveField_Clicked"/>
                    </Image.GestureRecognizers>
                </Image>
                <Button x:Name="p_btnSave" Text="Speichern" Clicked="p_btnSave_Clicked" FontSize="Large" HorizontalOptions="EndAndExpand"/>
            </StackLayout>
        </ListView.Footer>
    </ListView>
</ContentPage.Content>

DataType:
using System;

namespace xObjectMobile
{
public class PensumField
{
public TimeSpan fromTime { get; set; }
public TimeSpan toTime { get; set; }
public int selectedType { get; set; }
public string location { get; set; }
}

}

Data Class:
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;

namespace xObjectMobile
{
public class Pensum
{
public DateTime selectedDate { get; set; } = new DateTime(1998, 11, 21); //for now just a fixed date, not important
public PensumField standartPensumField { get; set; } = new PensumField //the standart field for adding a new row
{
fromTime = new TimeSpan(0, 8, 0, 0),
toTime = new TimeSpan(0, 16, 0, 0),
selectedType = 1,
location = "Berndorf"
};

    public static List<String> pensumTypes { get; set; }    //list for the picker to choose from
    public ObservableCollection<PensumField> pensumFields { get; set; } //ObservableCollection where the rows are stored in

    public Pensum()
    {
        pensumFields = new ObservableCollection<PensumField>();

        pensumTypes = new List<String>();
        //Fill PensumTypes
        pensumTypes.Add("type1");
        pensumTypes.Add("type2");
        pensumTypes.Add("type3");
    }
}

}

Code behind:
using System.Linq;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;

namespace xObjectMobile
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class PensumDetailPage : ContentPage
{
Pensum data = new Pensum();
public PensumDetailPage()
{
InitializeComponent();
BindingContext = data; //setting the binding context (correct?)
setStandartPensumFields(); //create the first three rows
}
private void p_btnSave_Clicked(object sender, EventArgs e)
{
//To be added
}
private void p_btnAddField_Clicked(object sender, EventArgs e)
{
if (data.pensumFields.Count < 9)
{
data.pensumFields.Add(data.standartPensumField);
}
}
private void p_btnRemoveField_Clicked(object sender, EventArgs e)
{
if (data.pensumFields.Count >= 1)
{
data.pensumFields.Remove(data.pensumFields.Last()); //also very strange: it removes the top one in the list
}
}
private void setStandartPensumFields()
{
for (int i = 0; i < 3; i++)
{
data.pensumFields.Add(data.standartPensumField);
}
}
}
}

How to close the current page and go back to the previous page

$
0
0

It looks a simple thing to do, but I didn't find anyway to make it.
How can I close the opened page and get back to the page I opened before it?

I tried Navigation.RemovePage(this); but it didn't work, how can I make it?

After Removing Page from Stack, Again Going to Same Page By PushAsync(), controls are not clickable

$
0
0

I am implementing Video Calling functionality for that i am calling form one other app and passing parameter to my app
when i am opening my App's
1)Incoming Call Page (has Accept/Reject Button) => For first time Accept/Reject Button is working perfect.
a) when i am clicking Accept Button
i am Navigating to OnGoingCallPage and Removing IncomingCallPage from Stack.
after disconnecting call
when i am calling again i am opening IncomingCallPage and (Accept/Reject button )
my problem is Accept/Reject Button is not clickable for second time.

When I am Removing (Killing) my App from RecentTask List then Accept/Reject button clicked every time .
What i am doing mistake.

Please Help,


Hunting Memory Leaks, best practices?

$
0
0

Hi,

I started a new Thread because this Title makes more sense.

What are your best strategies to hunt down MemoryLeaks, especialls on Android? How can I check if a certain object get's relased? Does it make sense to include a Debug.WriteLine into the Destructor of the Class of interest?

Does it make sense to call GC.Collect to see if memory stays constant?

Thanks for all help!

Best
Thomas

Android app data reset

$
0
0

I use SQLite database in my app. Everything worked fine up until recently. Now whenever I do new build from Studio on my Android device everything gets reset into a state that it was like several days ago. The same items are present and all changes that I did to them are lost.

Is there some way to fix this or clear this cache? Even if I remove app from device, Studio on next build inserts the save data.

How to print arabic text using ESC/POS commands ?

$
0
0

Hello,
I can't print arabic text using the ESC/POS commands. So, I used ESC + t + 40 + ".... Arabic text" but the printer prints incorrect text. Can you help me ?
Regards

UWP app breaks when the code execution comes to displayalert line

$
0
0

I am using displayalert in my project and it is working fine on android and ios devices. But for the UWP part it is not working in some pages. When the code execution comes to displayalert line the UWP app breaks and redirecting to App.g.i.cs. Code control comes to the following if block.

#if DEBUG && !DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION
        UnhandledException += (sender, e) =>
        {
            if (global::System.Diagnostics.Debugger.IsAttached) global::System.Diagnostics.Debugger.Break();
        };
#endif

If I mouse over the e showing {Windows.UI.Xaml.UnhandledExceptionEventArgs}

I am using the following code for display alert:

await DisplayAlert("Alert", "A verification code has been sent to your email.", "OK");

If I changed the above lines like below, no issue will come.

Device.BeginInvokeOnMainThread(async () => 
{
    await DisplayAlert("Alert", "A verification code has been sent to your email.", "OK");
});

Is there any solution to this issue without adding Device.BeginInvokeOnMainThread? And what is the reason behind this issue?

Offline Mobile apps with Large Scale of Data and Images

$
0
0

Hello Folks,

I am starting to build an application which is totally offline by nature, Users will have the replica of online database into their devices. I want to discuss an approach so that I can involve that efficiently.

I have large amount of data on client device with images as well. (Approximately more than 1L records in different tables and 1K of images).

I am using SQLite for local data storage and NewtonSoft.json for json serialization process. I am using AWS hosting for APIs.

Please suggest me whether It is good to go with Xamarin forms or native.

Any suggestion or architecture links will be helpful. Thanks!

Is it possible to detect left swipe multi-touch with “two fingers” on Xamarin.Forms?

How can i locate an app near by store

$
0
0

I have a store. This store is located in this coordinate(x,y). When any client is near(1000m or less) from store, this client will receive in your app some notification of advertising or discount. What should i do or how to do? I'm not requesting code but a path, a light. I don't know how to do or what to do.


Android Keyboard hides search results in ListView

$
0
0

I have an Entry at the top of my ContentPage, and a ListView that takes up the rest of the page. The ListView re-populates whenever the entry changes.

The problem is the Android Keyboard is hiding part of the ListView. IOS resizes the page so that we can scroll through the whole ListView, but on Android, I can't scroll all the way to the bottom of the ListView as it is hidden by the keyboard.

Any ideas?

Deploying HttpClient - NameResolutionFailure - only on iOS device

$
0
0

Hi All,

I'm having an issue with httpClient, but only on my iOS device (I've not checked Android but I'm not targeting it), it works well in the emulator.

When my app loads the ViewModels do a API call to try and get data from my server and I almost immediately get a System.Net.WebException: Error: NameResolutionFailure crash. I don't get this in the iOS emulator for the same API call.

I tried calling https://jsonplaceholder.typicode.com/posts which I know works and rules out anything idiosyncratic bugs in my code but it still fails.

Is there anything special I need to do enable internet access on an iOS device? Could I have set up something wrong in my provisioning profile in the Apple Account?

Thanks in advance

How can i download the pdf file with out opening the browser (With out using Device.OpenUri(pdfUr)

$
0
0

i need it like abackgroud proccess in my context it open the browser directly and ask me to download it but i need
to download it without asking the user . how can i remove the redirect proccess from the app to the browser and complete the process in the app.

thank you in advance.

Use the snackbar with xamarin.forms

$
0
0

I can't figure out how to get a reference to a View - has anyone managed to get this working (obviously just for android).

Bind List View from Bottom to Top

$
0
0

HI all,
I want to BInd data to my List view from Bottom to Top, Is there any Custom Renderer to do it? or any way?
please give me suggestions.

Thanks

Viewing all 91519 articles
Browse latest View live


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