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

Windows Phone UWP - Content is 'hidden' behind the Back/Home/Search button menu

$
0
0

I have a simple page with a grid view. The grid has two rows, the first has a height of *85, the second *15. However, the content in the second row is partially blocked by the Back/Home/Search buttons on the phone. Is this a bug? If not, what is a good way to work around this?

In case it matters, the content in the first row of the grid is a webview, and the content in the second row of the grid Is a horizontal stacklayout containing labels.


How can I change ViewCell height?

$
0
0

I have ViewCell in TableView, I need to put two buttons there:

                <ViewCell Height="100">
                    <StackLayout Margin="10,0">
                        <Button Text="Button 1" />
                        <Button Text="Button 2" />
                    </StackLayout>
                </ViewCell>

Height don't work. How can I change ViewCell's height?

OnAppearing of root page isn't fire after PopToRootAsync. Is it normal?

$
0
0

Hello. I have strange behavior. OnAppearing of root page isn't firing after PopToRootAsync and PopAsync. Is it normal or bug?
I think I solved this problem using messaging center, but I think it is not good solution.

How can I consume WCF service without Protable Class!

$
0
0

Hi,
As I know, right now we can't create project with Protable Class, so I don't know how to work with WCF. Anyone have a suggestion?

Getting Exception : Xamarin.Forms.Xaml.XamlParseException: Cannot assign property "Text"

$
0
0

Hi All,

I am Working on Multilingual functionality while i am binding my label with the Key , It is trowing Exception.
Please help Me.
`

<ContentPage.Content>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="100" />
            <RowDefinition Height="120" />
            <RowDefinition Height="200" />
            <RowDefinition Height="77" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="30" />
            <ColumnDefinition Width="280" />
            <ColumnDefinition Width="50" />
        </Grid.ColumnDefinitions>
        <StackLayout Grid.Row="1" Orientation="Vertical" Grid.Column="1">

            <Label Text="{translator:Translate OneApp}" TextColor="#FEFEFE" Font="15" HorizontalOptions="Center" VerticalOptions="Center" HorizontalTextAlignment="Center"></Label>
        </StackLayout>
    </Grid>
</ContentPage.Content>


`

Actuall working sample of Xamarin Form that does REST on Android

$
0
0

Can someone please provide an actual working sample of a Xamarin Forms project that also works with Android? We tried to use the TODORest Sample which initially wouldn't even build but after having downloaded the latest version from GitHub we at least got it to work. But communicate with the REST API just does not seem to work on Android (but does on UWP). There are numerous threads here and on other forums about similar problems with HttpClient, RestSharp etc.

Looking for a free DataMatrix writer

$
0
0

What the title says. The problem with ZXing is it writes only a low resolution DataMatrix which can't be upscaled.

NavigationPageRenderer - OnAttachedToWindow - Sequence contains no elements

$
0
0

We changed some code and now the Android app crashes on startup. This is what I got from the log:

Time Device Name Type PID Tag Message
07-26 10:14:26.356 LGE Nexus 5X Info 27331 MonoDroid System.InvalidOperationException: Sequence contains no elements
at System.Linq.Enumerable.Last[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x00010] in :0
at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.OnAttachedToWindow () [0x00011] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\NavigationPageRenderer.cs:211
at Android.Views.View.n_OnAttachedToWindow (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in <9ab9faae1b4b4f0da28e7c4ac61e2c78>:0
at (wrapper dynamic-method) System.Object:d392ac44-8ad7-4f92-9fdf-b7aceefc1fe7 (intptr,intptr)

I can see the code here:
https://github.com/xamarin/Xamarin.Forms/blob/master/Xamarin.Forms.Platform.Android/AppCompat/NavigationPageRenderer.cs

But, I'm powerless to stop the bug or detect why it is occurring. Could someone at Xamarin please put a better validation error message in this method? Or, could someone please recommend a work around? This code works fine on UWP.


How to implement autobackup in xamarin android project?

$
0
0

I went through the official android documentation for auto backup for android 6 and higher. it says that only thing required is to add into the manifest but this doesnt work somehow for me or i dont know what I should expect with that.

<manifest ... >
    ...
    <application android:allowBackup="true" ... >
        ...
    </application>
</manifest>

For example, when I look at whatsapp, under my google drive, i can see whatsapp backup together with my phone name backup. So question is my app is backed up into my phones full backup or doing that I expect a separate backup like whatsapp.

2nd question, whatsapp has options to change gmail account, frequency etc. How can we do it for our app? implementing xamarin.auth with google login can help but which api is it to change settings for backup?

iOS Map Memory Leaks

$
0
0

I'm running the latest version for Forms and iOS, and I am seeing VKMapView crashes occurring on iOS when navigating between pages with Map controls on them.

Anyone else seeing this behavior? If so, are there are any workarounds? I've included my crash log.

Thread 0 name: tid_303 Dispatch queue: com.apple.main-thread
Thread 0:
0 libc++.1.dylib 0x00000001833b7fcc std::1::__shared_weak_count::lock() + 4
1 VectorKit 0x0000000194096174 gss::StylesheetManager::clearCaches() + 88
2 VectorKit 0x0000000194091628 -[VKMapModel flushCaches:] + 140
3 VectorKit 0x000000019404a300 md::CartographicRenderer::prune(md::PruneLevel) + 44
4 VectorKit 0x0000000194055e00 -[VKMapView didReceiveMemoryWarning:] + 232
5 VectorKit 0x0000000194194d84 -[VKMemoryObserver triggerMemoryNotification:] + 116
6 VectorKit 0x0000000194194e30 __56-[VKMemoryObserver initWithTarget:selector:taskContext:]_block_invoke + 44
7 libdispatch.dylib 0x0000000183b36a14 _dispatch_client_callout + 12
8 libdispatch.dylib 0x0000000183b73640 _dispatch_continuation_pop$VARIANT$armv81 + 416
9 libdispatch.dylib 0x0000000183b7c858 _dispatch_source_invoke$VARIANT$armv81 + 524
10 libdispatch.dylib 0x0000000183b77b64 _dispatch_main_queue_callback_4CF$VARIANT$armv81 + 680
11 CoreFoundation 0x0000000184162544 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE
+ 8
12 CoreFoundation 0x0000000184160120 __CFRunLoopRun + 2008
13 CoreFoundation 0x000000018407fe58 CFRunLoopRunSpecific + 432
14 GraphicsServices 0x0000000185f2cf84 GSEventRunModal + 96
15 UIKit 0x000000018d7d467c UIApplicationMain + 232

Using Visual Studio 2017, any coding error results in "The application is in break mode"

$
0
0

Take the following code:
var x = new List();
var y = x[3];

When debugging a UWP project, Visual Studio stops on the offending line and produces the expected error: "System.ArgumentOutOfRangeException: 'Index was out of range..."

Using the same solution, Android or iOS project, instead of breaking on the incorrect code, Visual Studio displays the "Break Mode" tab with "The application is in break mode". The Exception details only state "An unhandled exception occurred"

Anyone have any idea how to get Visual Studio to break on the offending line?

Is there a way to grayscale an image in Xamarin Forms?

$
0
0

You know how you can disable buttons and they have a disable color. Well lets say we have an image on a row that I also want to turn black and white depending on if that item is active or not. Is there anything available for this?

Android Form Keyboard Scroll

$
0
0

Hi guys,

I'm having a problem with a simple form. When an entry is clicked and the keyboard pops up, the toolbar just scrolls up and I can't scroll up to the next field. I am using the toolbar layout for Android and I'm suspecting that it might have something to do with this.

My structure:
Relative Layout -> Scrollview Layout -> Stacklayout -> bunch of entries

The axml Android Layout I'm using is the following:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:layout_scrollFlags="scroll|enterAlways" />

Has anyone been experiencing the same problems?

Thanks
Shaun

Listview, custom cell and data binding

$
0
0

Hi all! After some research and after following some guides I have not yet managed to use a listview with a custom cell,
my problem is that when I fill the list with the model class the views are not initialized with the data.

my view class is

public class TrafficView : ViewCell
{
public static readonly BindableProperty ByteProperty = BindableProperty.Create("mbyte", typeof(string), typeof(TrafficView),"");
public static readonly BindableProperty ProgressProperty = BindableProperty.Create("progress", typeof(double), typeof(TrafficView), 0.0);
public static readonly BindableProperty CountryProperty = BindableProperty.Create("country", typeof(string), typeof(TrafficView), "");

    private static void mbytePropertyChanged(BindableObject bindable, object oldValue, object newValue)
    {
        //((TrafficView)bindable).Byte = newValue.ToString();
    }

    public string mbyte
    {
        get
        {
            return (string)GetValue(ByteProperty);
        }

        set
        {
            SetValue(ByteProperty, value);
            this.pBar.LabelStringFormat = value;
        }
    }

    public double progress
    {

        get
        {
            return (double)GetValue(ProgressProperty);
        }

        set
        {
            SetValue(ProgressProperty, value);
            this.pBar.Progress = value;
        }
    }

    public string country
    {

        get
        {
            return (string)GetValue(CountryProperty);
        }

        set
        {
            SetValue(CountryProperty, value);
            this.country.Text = value;
        }
    }

    public TrafficView()
    {
        initView();
    }


    public ProgressBarView pBar { get; set; }  
    public String total { get; set; } 
    public Label country { get; set; }

    private void initView()
    {
    .............................. some code ............................
        SetBinding(ByteProperty, new Binding("mbyte"));
    SetBinding(ProgressProperty, new Binding("progress"));
    SetBinding(CountryProperty, new Binding("country"));
        this.BindingContext = this;
    }

}

my model is

public class TrafficModel
{
public string country { get; set;}
public double progress { get; set;}
public string mbyte { get; set;}

    public TrafficModel(String mbyte,double progress,String country)
    {
        this.country = country;
        this.progress = progress;
        this.mbyte = mbyte;
    }

    public TrafficModel(){
        country = "";
        progress = 0;
        mbyte = "0";
    }
}

and my list view

    ListView soglieListView = new ListView();
        soglieListView.RowHeight = 140;
        soglieListView.SeparatorColor = Color.White;
        soglieListView.ItemTemplate = new DataTemplate(typeof(TrafficView));

        ObservableCollection<TrafficModel> trafficList = new ObservableCollection<TrafficModel>();
        for (int i = 0; i < soglie.Count;i++){
            trafficList.Add(new TrafficModel("Prova",3,"Prova"));
        }

        soglieListView.ItemsSource = trafficList;

what I did not understand?

Where is the build log?

$
0
0

When I'm running a Xamarin forms app via my iOS Emulator with Visual Studio on Windows, where specifically do I view the build log? Is it on my windows box or over on the mac mini that I have attached?

I'm getting an error that states: Native linking failed. Please review the build log

I'm not talking about the output window, but rather the build log they are referring to.


How to get Height and Width in UWP Custom Renderer Control

$
0
0

I have a UWP custom renderer that I am perform some drawing in the native control based on a UWP Canvas. I need the height and width of the Xamarin.Forms.View so that I can adjust my drawing accordingly. I have tried passing the Element height and width to the control but it always has a value of -1. In iOS renderer I send in the UIView.Bounds and in Android you pass the context and override OnDraw which has the Android Canvas which gives you this values. So does anyone know how to get the same values from UWP in the renderer? I have tried for hours to get the height and width of the View.

Orgbrat

Generating custom pins from using longitude and latitude values from a database.

$
0
0

Hi all, I'm currently working on a project in which I am using a custom map renderer with custom pins. I am using a firebase database to store the information. I was just wondering if there is a way to generate x amount of pins using the longitude and latitude values they have. I've been stuck on this for a while and cant seem to find the answer anywhere online.

Cheers!

PopAsync does not go back to pervious page

$
0
0

There are 3 pages in the navigation stack, a, b and c. When I use Navigation.PopAsync() inside c, c is removed from the stack but does not go back to the pervious page b.

I want to create a regular expressions

$
0
0

I want to create two regular expressions which is take the value between 0 to 90 only and other is 0 to -180 only & take 6 digit only after .(dot)

How to add image in navigation bar (Title bar) in xamarin.forms

$
0
0

Hi,

How to add image in navigation bar (Title bar) in xamarin.forms?

Viewing all 58056 articles
Browse latest View live


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