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

App has entered a break state, but there is no code to show. Any Solution ?

$
0
0

06-06 03:54:55.124 I/art (10405): Starting a blocking GC Explicit
06-06 03:54:55.125 D/Mono (10405): GC_BRIDGE waiting for bridge processing to finish
06-06 03:54:55.131 I/art (10405): Explicit concurrent mark sweep GC freed 1176(67KB) AllocSpace objects, 6(120KB) LOS objects, 22% free, 55MB/71MB, paused 195us total 7.110ms
06-06 03:54:55.132 D/Mono (10405): GC_TAR_BRIDGE bridges 74 objects 114 opaque 18 colors 74 colors-bridged 74 colors-visible 74 xref 0 cache-hit 0 cache-semihit 0 cache-miss 0 setup 0.05ms tarjan 0.04ms scc-setup 0.03ms gather-xref 0.00ms xref-setup 0.00ms cleanup 0.02ms
06-06 03:54:55.132 D/Mono (10405): GC_BRIDGE: Complete, was running for 7.70ms
06-06 03:54:55.132 D/Mono (10405): GC_MAJOR: (LOS overflow) time 6.31ms, stw 7.20ms los size: 4096K in use: 431K
06-06 03:54:55.132 D/Mono (10405): GC_MAJOR_SWEEP: major size: 2528K in use: 1558K
06-06 03:54:55.166 I/Choreographer(10405): Skipped 225 frames! The application may be doing too much work on its main thread.
06-06 03:54:55.492 W/art (10405): JNI RegisterNativeMethods: attempt to register 0 native methods for md5b60ffeb829f638581ab2bb9b1a7f4f3f.CellRenderer_RendererHolder
06-06 03:54:56.770 I/Choreographer(10405): Skipped 96 frames! The application may be doing too much work on its main thread.
06-06 03:54:57.710 I/Choreographer(10405): Skipped 55 frames! The application may be doing too much work on its main thread.
06-06 03:54:59.742 D/Mono (10405): GC_BRIDGE waiting for bridge processing to finish
06-06 03:54:59.744 I/art (10405): Starting a blocking GC Explicit
06-06 03:54:59.755 I/art (10405): Explicit concurrent mark sweep GC freed 8720(481KB) AllocSpace objects, 96(1920KB) LOS objects, 21% free, 59MB/75MB, paused 241us total 8.712ms
06-06 03:54:59.756 D/Mono (10405): GC_TAR_BRIDGE bridges 476 objects 538 opaque 36 colors 476 colors-bridged 476 colors-visible 476 xref 0 cache-hit 0 cache-semihit 0 cache-miss 0 setup 0.06ms tarjan 0.12ms scc-setup 0.12ms gather-xref 0.01ms xref-setup 0.00ms cleanup 0.04ms
06-06 03:54:59.756 D/Mono (10405): GC_BRIDGE: Complete, was running for 12.82ms
06-06 03:54:59.756 D/Mono (10405): GC_MAJOR: (LOS overflow) time 8.76ms, stw 12.14ms los size: 2048K in use: 382K
06-06 03:54:59.756 D/Mono (10405): GC_MAJOR_SWEEP: major size: 2864K in use: 1831K
06-06 03:55:05.344 I/art (10405): Starting a blocking GC Explicit
06-06 03:55:05.357 I/art (10405): Explicit concurrent mark sweep GC freed 14562(891KB) AllocSpace objects, 92(1840KB) LOS objects, 20% free, 60MB/76MB, paused 172us total 13.522ms
06-06 03:55:05.366 D/Mono (10405): GC_TAR_BRIDGE bridges 688 objects 15011 opaque 8073 colors 688 colors-bridged 688 colors-visible 688 xref 0 cache-hit 0 cache-semihit 0 cache-miss 0 setup 0.04ms tarjan 2.48ms scc-setup 0.09ms gather-xref 0.01ms xref-setup 0.00ms cleanup 6.72ms
06-06 03:55:05.366 D/Mono (10405): GC_BRIDGE: Complete, was running for 23.10ms
06-06 03:55:05.366 D/Mono (10405): GC_MINOR: (Nursery full) time 6.70ms, stw 7.73ms promoted 317K major size: 3104K in use: 2164K los size: 6144K in use: 4512K
Resolved pending breakpoint at 'Page.xaml.cs:95,1' to void App.Views.Page.Direction_Tapped (object sender, System.EventArgs e) [0x0002b].
06-06 03:55:07.455 W/art (10405): JNI RegisterNativeMethods: attempt to register 0 native methods for md59aae9af96037b942fd11ad60aea06411.HyperlinkLabelRenderer
06-06 03:55:07.464 D/Mono (10405): DllImport searching in: '__Internal' ('(null)').
06-06 03:55:07.464 D/Mono (10405): Searching for 'java_interop_jnienv_call_static_boolean_method_a'.
06-06 03:55:07.464 D/Mono (10405): Probing 'java_interop_jnienv_call_static_boolean_method_a'.
06-06 03:55:07.464 D/Mono (10405): Found as 'java_interop_jnienv_call_static_boolean_method_a'.
06-06 03:55:07.484 V/WebViewFactory(10405): webViewPackageName: com.google.android.webview
06-06 03:55:07.485 I/WebViewFactory(10405): Loading com.google.android.webview version 66.0.3359.158 (code 335915810)
06-06 03:55:07.586 W/System (10405): ClassLoader referenced unknown path: /system/app/WebViewGoogle/lib/x86
06-06 03:55:07.745 I/art (10405): Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.TokenBindingManagerAdapter>
06-06 03:55:07.745 I/art (10405): Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.TokenBindingManagerAdapter>
06-06 03:55:07.748 I/art (10405): Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.ServiceWorkerControllerAdapter>
06-06 03:55:07.748 I/art (10405): Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.ServiceWorkerControllerAdapter>
06-06 03:55:07.754 I/cr_LibraryLoader(10405): Time to load native libraries: 2 ms (timestamps 7368-7370)
[INFO:library_loader_hooks.cc(36)] Chromium logging enabled: level = 0, default verbosity = 0
06-06 03:55:07.902 I/chromium(10405): [INFO:library_loader_hooks.cc(36)] Chromium logging enabled: level = 0, default verbosity = 0
06-06 03:55:07.902 I/cr_LibraryLoader(10405): Expected native library version number "66.0.3359.158", actual native library version number "66.0.3359.158"
06-06 03:55:07.924 I/cr_BrowserStartup(10405): Initializing chromium process, singleProcess=true
06-06 03:55:07.924 I/cr_base (10405): Android Locale: en_US requires .pak files: []
[ERROR:devtools_http_handler.cc(292)] Cannot start http server for devtools. Stop devtools.
06-06 03:55:08.094 E/chromium(10405): [ERROR:devtools_http_handler.cc(292)] Cannot start http server for devtools. Stop devtools.
06-06 03:55:08.210 I/Choreographer(10405): Skipped 56 frames! The application may be doing too much work on its main thread.
06-06 03:55:08.218 W/View (10405): requestLayout() improperly called by md5b60ffeb829f638581ab2bb9b1a7f4f3f.ScrollViewContainer{4881312 V.E...... ......ID 0,0-1067,2194} during layout: running second layout pass
06-06 03:55:08.395 D/ConnectivityManager.CallbackHandler(10405): CM callback handler got msg 524290
06-06 03:55:08.433 W/View (10405): requestLayout() improperly called by md5270abb39e60627f0f200893b490a1ade.NavigationPageRenderer{3f1402e V.E...... ......ID 0,0-1080,1731 #1} during second layout pass: posting in next frame
06-06 03:55:08.692 W/cr_CrashFileManager(10405): /data/user/0/com.blueferns.App/cache/WebView/Crash Reports does not exist or is not a directory
06-06 03:55:09.633 D/Mono (10405): Assembly Ref addref App[0xda5223e0] -> Xamarin.Forms.Maps[0xda521a20]: 3
Resolved pending breakpoint at 'CustomMap.cs:96,1' to void App.Controls.CustomMap..ctor () [0x0003e].
06-06 03:55:09.764 I/Google Maps Android API(10405): Google Play services package version: 12687026
06-06 03:55:10.140 D/Mono (10405): Assembly Ref addref Xamarin.Forms.Maps.Android[0xda5219c0] -> System.Core[0xda522da0]: 9
06-06 03:55:10.168 D/ (10405): HostConnection::get() New Host Connection established 0xd0b0bbb0, tid 10511
An unhandled exception occured.

06-06 03:55:12.104 W/DynamiteModule(10405): Local module descriptor class for com.google.android.gms.googlecertificates not found.
06-06 03:55:12.109 I/DynamiteModule(10405): Considering local module com.google.android.gms.googlecertificates:0 and remote module com.google.android.gms.googlecertificates:4
06-06 03:55:12.109 I/DynamiteModule(10405): Selected remote version of com.google.android.gms.googlecertificates, version >= 4
06-06 03:55:12.113 W/System (10405): ClassLoader referenced unknown path: /data/data/com.google.android.gms/app_chimera/m/00000005/n/x86
06-06 03:55:12.113 W/System (10405): ClassLoader referenced unknown path: /data/data/com.google.android.gms/app_chimera/m/00000005/n/armeabi-v7a
06-06 03:55:12.113 W/System (10405): ClassLoader referenced unknown path: /data/data/com.google.android.gms/app_chimera/m/00000005/n/armeabi


How to load an XPS format file in Xamarin.Forms

$
0
0

I have a requirement to load an XPS format file on iPad. Kindly suggest any solution for Xamarin.Forms.

Pixel perfect designs across all platforms

$
0
0

We live in the world where no one likes the platform specific look for enterprise apps other than developers. Many times a business needs consistent looking UI look across platforms. OnPlatform helps but it's not sufficient. How do you guys handle this kind of situations where we need to have pixel perfect UI across platforms. After delivering 5 Xamarin apps, I can say that we get near around 80-90 percentage but not 100% but again it's not that easy. Ideas, suggestions which can help us to make our lives easier?

Xamarin build error, please help

$
0
0

I have purchased Visual studio 2017 professional edition .I selected xamarin developement.I just created project as follows

In visual C#,Cross Plateform -> Cross Platform Apps or Native->Blank APP .UI technology Xamarin forms option
And Portable Class Library.And Just build project.I Get following error.Please let me know If any nuget package needs to be updated,Or what else should I do?.I need answer as early as possible.I am getting following error.

Severity Code Description Project File Line Suppression State
Error An error occurred trying to install required android components on Project 'App5.Android'.
Project 'App5.Android' requires the following components installed on your machine:
Xamarin.Android.Support.v7.AppCompat
JavaLibraryReference: https://dl-ssl.google.com/android/repository/android_m2repository_r29.zip-m2repository/com/android/support/appcompat-v7/23.3.0/appcompat-v7-23.3.0.aar-23.3.0.0
AndroidResources: https://dl-ssl.google.com/android/repository/android_m2repository_r29.zip-m2repository/com/android/support/appcompat-v7/23.3.0/appcompat-v7-23.3.0.aar-23.3.0.0
Xamarin.Android.Support.v7.MediaRouter
JavaLibraryReference: https://dl-ssl.google.com/android/repository/android_m2repository_r29.zip-m2repository/com/android/support/mediarouter-v7/23.3.0/mediarouter-v7-23.3.0.aar-23.3.0.0
JavaLibraryReference: https://dl-ssl.google.com/android/repository/android_m2repository_r29.zip-m2repository/com/android/support/mediarouter-v7/23.3.0/mediarouter-v7-23.3.0.aar-23.3.0.0
AndroidResources: https://dl-ssl.google.com/android/repository/android_m2repository_r29.zip-m2repository/com/android/support/mediarouter-v7/23.3.0/mediarouter-v7-23.3.0.aar-23.3.0.0

Please double-click here to install it.

Intallation Errors: XA5209 Unzipping failed. Please download 'https://dl-ssl.google.com/android/repository/android_m2repository_r29.zip:m2repository/com/android/support/appcompat-v7/23.3.0/appcompat-v7-23.3.0.aar' and extract it to the 'C:\Users\Aditya\AppData\Local\Xamarin\Xamarin.Android.Support.v7.AppCompat\23.3.0.0\embedded' directory
XA5209 Reason: The process cannot access the file 'C:\Users\Aditya\AppData\Local\Xamarin\Xamarin.Android.Support.v7.AppCompat\23.3.0.0\embedded\res\drawable-xxhdpi-v4' because it is being used by another process.
XA5207 Please install package: 'Xamarin.Android.Support.v7.AppCompat' available in SDK installer. Java library file 'C:\Program Files (x86)\Android\android-sdk\extras\android\classes.jar' doesn't exist.
XA5207 Please install package: 'Xamarin.Android.Support.v7.MediaRouter' available in SDK installer. Java library file 'C:\Program Files (x86)\Android\android-sdk\extras\android\classes.jar' doesn't exist.
XA5207 Please install package: 'Xamarin.Android.Support.v7.MediaRouter' available in SDK installer. Java library file 'C:\Program Files (x86)\Android\android-sdk\extras\android\libs/internal_impl-23.3.0.jar' doesn't exist. 0

Xamarin Forms Entry - Keyboard property not working in UWP

$
0
0

In Xaml Page,

In Android, it shows the numeric keyboard
but in Windows UWP app, entry is taking alphabets as well.

Navigation Drawer is Not Collapsing

$
0
0

Hi,
I'm working on MasterDetail page In Xamarin.forms. I can able to display NavigationDrawer with Menu Items in Android(Tablet) and in UWP(Not mobile view). But the Navigation Drawer is not hiding. Are there any additional features I have to apply. Thanks in Advance.

Regards,
Bhavana

Problem with Xamarin FilePicker plugin for iOS

$
0
0

Hello,

I have the following problem with FilePicker plugins for iOS:

I have a xamarin project for all platforms and I want to select pdf file and upload it via some API.
For UWP and Android this works without problem but for iOS I have the following issue:
* The following is called: await CrossFilePicker.Current.PickFile();
* iPad - nothing happens, no menu appears and when i click on the button again I get an exception that only one operation is possible at the moment which comes from the code in the plugin
* iPhone - menu appears and I select option browse and then can select the file from iCloud but the file is not returned so I still get nothing, the application hangs and if I click twice on the button I have the same exception as for the iPad

The following plugins were tried but the result was the same for all of them:
* Studyxnet FilePicker
* Proyoyo FilePicker

Also cloud driver was configured for the application.

Truly Bindable Maps, gauging demand

$
0
0

Hey Forms Community.

For the past several months I've been neck deep in maps, and I've nearly re-written Xamarin.Forms.Maps entirely. I'm trying to gauge the demand for truly bindable maps, and if I should submit this stuff back to Xamarin.

Features:

  • BindableMarker (all properties are bindable)
    • public Xamarin.Forms.Color Color;... yes that's right, full RGB marker support for markers
    • public event MarkerSelected;
    • public event MarkerDeselected;
  • BindablePolygon (all properties are bindable)
    • public bool IsVisible;
    • public IEnumberable<IList<Position>> Holes;
    • public IEnumerable<Position> Area;
    • public Xamarin.Forms.Color FillColor;
    • public Xamarin.Forms.Color StrokeColor;
  • NativeMarkerImage
    • public Xamarin.Forms.Color Color; - a View with a custom renderer allowing you to extract the native map pin into your XAML code.
  • BindableMap
    • Lots and lots. The highlights here are the fact that markers are truly bindable without leveraging the native map's clear(); methods. This allows us to keep callouts open and keep unchanging markers on the view at all times.
    • Has a CalloutTemplate that allows us to write our callouts in Xaml (see example below)
    • Fixes VisibleRegion to allow us to set the visible region from the ViewModel (two way binding).
    • public event EventHandler<MapBoundsChangedEventArgs> BoundsChanged;
    • public event EventHandler MapLoaded;
    • public event EventHandler MarkersChanging;
    • public event EventHandler PolygonsChanging;
    • public event EventHandler MarkersChanged;
    • public event EventHandler PolygonsChanged;
    • public event EventHandler MapClicked;
    • LatLongBounds - new class that should be part of MapSpan
    • returns the NorthEast and the SoutWest corners of the visible map
    • public bool Contains(IEnumerable<Position>);
    • might expose CalculateCentroid();

side note: I've completely done away the the MessagingCenter as I'm really not a fan. I have hard event subscriptions between the PCL and the native, and they're not exposed to you... just to keep it clean.

image

note: the video above is on iOS, but it works equally as well on Android... even the native Android markers and a fully bindable callout... and yes, even buttons on the callout work for Android. - what a PITA that was.

Here's the xaml for a map

<rdr:ExtendedMap x:Name="StreetlightsMap" 
                  HorizontalOptions="FillAndExpand"
                  MapClicked="StreetlightsMap_OnMapClicked"
                  MapLoaded="StreetlightsMap_OnMapLoaded"
                  VerticalOptions="FillAndExpand"
                  MarkerSource="{Binding Streetlights}"
                  MapBounds="{Binding MapBounds}"
                  VisibleRegion="{Binding VisibleRegion}"
                  ServiceArea="{Binding ServiceArea}"
                  HideOutOfViewElements="False"
                  AllowRotation="False"
                  MarkerAlignmentForCallout="Bottom"
                  MapType="{Binding MapType}"
                  RelativeLayout.XConstraint="{ConstraintExpression Type=Constant, Constant=0}"
                  RelativeLayout.YConstraint="{ConstraintExpression Type=Constant, Constant=0}"
                  RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1 }"
                  RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1 }">
    <rdr:ExtendedMap.Behaviors>
        <behaviors:MapBoundsChangedCommandBehavior Command="{Binding GetStreetlightsCommand}"
                                                    CommandParameter="{Binding .}" />
    </rdr:ExtendedMap.Behaviors>
    <rdr:ExtendedMap.CalloutTemplate>
        <DataTemplate>
            <controls:StreetlightMarkerCallout />
        </DataTemplate>
    </rdr:ExtendedMap.CalloutTemplate>
    <!-- Sets the initial map location.-->
    <x:Arguments>
        <maps:MapSpan>
            <x:Arguments>
                <!-- These coordinates land near Red Deer at a fairly high altitude (birds eye view). -->
                <maps:Position>
                    <x:Arguments>
                        <!-- Latitude-->
                        <x:Double>52.325</x:Double>
                        <!-- Longitude-->
                        <x:Double>-113.9</x:Double>
                    </x:Arguments>
                </maps:Position>
                <!-- Elevation lat/long-->
                <x:Double>.8</x:Double>
                <x:Double>.8</x:Double>
            </x:Arguments>
        </maps:MapSpan>
    </x:Arguments>
</rdr:ExtendedMap>

and here's the xaml for a callout

<?xml version="1.0" encoding="utf-8"?>

<customMap:BindableMapCallout xmlns="http://xamarin.com/schemas/2014/forms"
                              xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                              xmlns:loc="clr-namespace:MyApp.Mobile.Localization;assembly=MyApp.Mobile"
                              xmlns:customMap="clr-namespace:MyApp.Mobile.CustomMap;assembly=MyApp.Mobile"
                              x:Class="MyApp.Mobile.Controls.StreetlightMarkerCallout"
                              Title="{loc:Translate StreetlightCallout_Title}">
    <StackLayout Padding="0">

        <!-- Address-->
        <Label Text="{loc:Translate StreetlightCallout_Address}"
               Style="{StaticResource Common-BoldText}" />
        <!-- this stupidity exists because the iOS callout doesn't auto-resize... yet. -->
        <Label Text="{Binding Address}" HeightRequest="45" WidthRequest="200">
            <Label.IsVisible>
                <OnPlatform x:TypeArguments="x:Boolean" Android="False" iOS="True" />
            </Label.IsVisible>
        </Label>
        <Label Text="{Binding Address}">
            <Label.IsVisible>
                <OnPlatform x:TypeArguments="x:Boolean" Android="True" iOS="False" />
            </Label.IsVisible>
        </Label>

        <Label Text="Repair Requested Date:"
               Style="{StaticResource Common-BoldText}"
               IsVisible="{Binding IsOut}" />
        <Label Text="{Binding RepairRequestedDate}"
               IsVisible="{Binding IsOut}" />

        <!--Information-->
        <Label Text="{loc:Translate StreetlightCallout_Info}"
               Style="{StaticResource Common-BoldText}" />
      <!-- this stupidity exists because the iOS callout doesn't auto-resize... yet. -->
      <Label Text="{Binding Info}" HeightRequest="65" WidthRequest="220">
        <Label.IsVisible>
          <OnPlatform x:TypeArguments="x:Boolean" Android="False" iOS="True" />
        </Label.IsVisible>
      </Label>
      <Label Text="{Binding Info}">
        <Label.IsVisible>
          <OnPlatform x:TypeArguments="x:Boolean" Android="True" iOS="False" />
        </Label.IsVisible>
      </Label>

        <!-- Report Button-->
        <Button Text="{loc:Translate StreetlightCallout_RepairButtonText}"
                HorizontalOptions="FillAndExpand"
                VerticalOptions="Center"
                Command="{Binding ReportStreetlightCommand}"
                BorderRadius="0"
                BorderWidth="0"
                CommandParameter="{Binding .}"
                IsVisible="{Binding SubmitButtonVisible}" />
    </StackLayout>
</customMap:BindableMapCallout>

Firebase OnTokenRefresh not getting called?

$
0
0

I am working with xamarin mobile app. OnTokenRefresh does not get called when app is first time installed in my mobile. Also i have filled all necessary permission and everything into manifest.xml page but not working. I know when first time its installed then it will call. but sometime it calls sometime not. I dont know why? Plesase suggest me the solution.

I want to do processing when the application is not running.

$
0
0

I want to do processing when the application is not running.
Is it possible to run the program at intervals of several minutes when the application is not running?

How to set Centered image in toolbar in xamarin forms

$
0
0

I tried to put image aligned center in toolbar "toolbarlogo" .. how can i do that

  <TabbedPage.ToolbarItems>
        <ToolbarItem  Name="MenuItem1" Order="Primary" Icon="cart" Command="{Binding GoToCart}" Priority="3" />
        <ToolbarItem  Name="MenuItem2" Order="Primary" Icon="search" Command="{Binding GotoSearch}" Priority="2" />

        <ToolbarItem  Name="MenuItem3" Order="Primary" IsEnabled="False" Icon="toolbarlogo" Priority="0" />

    </TabbedPage.ToolbarItems>

WiFiManager.ScanResults now work. error

$
0
0

I have two projects. The code for both projects is the same and the permission settings in AndroidManifest.xml are the same.
But one project works well. However, one project works fine and the other project always returns an empty list.

var wifiManager = (WifiManager)Android.App.Application.Context.GetSystemService(Context.WifiService); IList<ScanResult> list = wifiManager.ScanResults;

Set background image and opacity but not the text in the screen

$
0
0

I have set an image as background in the Content Page

But the text or labels inside it affecting the opacity even though I have set the stacklayout opacity to 1. Everything in the screen applied by the opacity i have set in the background image. My goal is to set a background image as water mark to the login screen thats why I need to set the background image into opacity.

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 x:Class="Login"
                 Title="Login"
                 BackgroundImage="login.png"
                 Opacity="0.1">
        <ContentPage.Content>
            <StackLayout Opacity="1">
                <StackLayout Padding="15">
                    <Image Aspect="AspectFit" Source="truck_black.png"
                            WidthRequest="130" HeightRequest="100"/>
                </StackLayout>
                <ScrollView>
                    <StackLayout Spacing="0">
                        <StackLayout Padding="15,7,15,15" VerticalOptions="StartAndExpand">
                            <StackLayout VerticalOptions="StartAndExpand">
                                <Label Text="Company Code" TextColor="Black" FontSize="14"/>
                                <Entry x:Name="companyCodeEntry" TextColor="Black" Text="" FontSize="14"/>
                                <Label Text="Username" TextColor="Black" FontSize="14"/>
                                <Entry x:Name="usernameEntry" TextColor="Black" Text="" FontSize="14"/>
                                <Label Text="Password" TextColor="Black" FontSize="14"/>
                                <Entry x:Name="passwordEntry" IsPassword="true" TextColor="Black" Text="" FontSize="14"/>
                            </StackLayout>
                        </StackLayout>
                    </StackLayout>
                </ScrollView>
            </StackLayout>
        </ContentPage.Content>
    </ContentPage>

OnAppearing method called for every open page when returning from Camera app

$
0
0

As per title, when I open the camera app using Plugin.Media, once the photo is taken and confirmed/saved and focus is returned back to my app, the OnAppearing method is being called for every page that has been navigated to before the camera app was opened. Is there a way to stop this from happening?

Listview within a scrollable view

$
0
0

I have a page which has 3 static questions, followed by a Listview which is binded to a dynamic list of questions (number of questions can change meaning the height of the listview needs to change)

Currently the listview is a static height. I need the listview to be dynamic and change height based on the number of questions.

The listview is in a scrollable view, if i take it out I end up having two scrollable sections within the page which I do not want.

How do I get the listview to expand as needed? I'm happy to use another control if more suitable. I'd like a solution which uses the MVVM framework if possible.

Below is the XAML for the listview:

            <ListView ItemsSource="{Binding AdditionalFields}" RowHeight="75" BackgroundColor="Green" VerticalOptions="FillAndExpand"  HasUnevenRows="True">
                <ListView.ItemTemplate >
                    <DataTemplate>
                        <ViewCell>
                            <ContentView BackgroundColor="Yellow">
                                <Grid>
                                    <Image Source="{Binding ProductImage}"/> <!--Image not showing-->
                                    <Label Text="{Binding DefaultName}" Style="{DynamicResource labelInformationStyle}" HorizontalOptions="StartAndExpand" Margin="15, 10, 0, 0"/>
                                    <controls:AdditionalFieldControl  />
                                </Grid>
                            </ContentView>
                        </ViewCell>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>

Here is my AdditionalFieldControl constructor (which allows the user to enter an answer to the question) which is used in the snippet above (I know the fields aren't binded yet).

public AdditionalFieldControl()
        {
            //Set the the entry to fill and expand
            this.HorizontalOptions = new LayoutOptions() { Alignment = LayoutAlignment.Start, Expands = true,  };

            _entry = new Entry()
            {
                Placeholder = "Type input ...",// this.TextPlaceholder,
                PlaceholderColor = Xamarin.Forms.Color.Gray,
                Text = this.Text,
                TextColor = Xamarin.Forms.Color.Black,
                FontAttributes = FontAttributes.None,
                HeightRequest = 200,
                Margin = new Thickness(15, 25, 0, 0)
            };

            //add the entry to the stack layout 
            this.Children.Add(_entry);
        }

Please let me know if you need anymore information, thanks in advance for any help.

I'm debugging on a Samsung Galaxy S5 mini
Android version: 6.0.1


how to get current Orientation in xamarin forms

$
0
0

how to check display is in portrait or landscape mode in xamarin forms?

DataTemplate with TemplateSelector - bind to parent command

$
0
0

Hi all

I have a ListView with a TemplateSelector and two different DataTemplates (ViewCells). Behind the ListView is a ViewModel for the ConentPage with an ObservableCollection which contains some item-models. The Binding to this Item-Model in my templates work like a charm.

What I want: My ContentPage-ViewModel has some commands. The DataTemplate should use this command. How can I bind to this commands?

I know, that I can make the commands static and reference with x:Static to it. Or I can add the Command to my Item-Model. But both are no Option for my solution.

Thanks in advance

Errors when referenace android project to ui test project Xamarin

$
0
0

Hello i have a intruder problem, i have created a xamarin form solution with monoandroid 8.1 and .net standard 2.0 and every thing going fine, once i have add UI test project and add android project as reference i see 4 errors but when i build it build successfully and still see error, and when i build it in app center it fails and show me those 4 errors

and this is log from app center

2018-06-11T10:26:21.6746020Z NU1201: Project UserLogin.Android is not compatible with net471 (.NETFramework,Version=v4.7.1). Project UserLogin.Android supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.6783670Z NU1202: Package Xamarin.Android.Support.Design 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1). Package Xamarin.Android.Support.Design 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.6823120Z NU1202: Package Xamarin.Android.Support.v7.AppCompat 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1). Package Xamarin.Android.Support.v7.AppCompat 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.6861720Z NU1202: Package Xamarin.Android.Support.v4 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1). Package Xamarin.Android.Support.v4 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.6902870Z NU1202: Package Xamarin.Android.Support.v7.CardView 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1). Package Xamarin.Android.Support.v7.CardView 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.6943750Z NU1202: Package Xamarin.Android.Support.v7.MediaRouter 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1). Package Xamarin.Android.Support.v7.MediaRouter 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.6981290Z NU1201: Project UserLogin.Android is not compatible with net471 (.NETFramework,Version=v4.7.1) / win. Project UserLogin.Android supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.7019080Z NU1202: Package Xamarin.Android.Support.Design 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1) / win. Package Xamarin.Android.Support.Design 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.7057150Z NU1202: Package Xamarin.Android.Support.v7.AppCompat 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1) / win. Package Xamarin.Android.Support.v7.AppCompat 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.7095020Z NU1202: Package Xamarin.Android.Support.v4 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1) / win. Package Xamarin.Android.Support.v4 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.7132900Z NU1202: Package Xamarin.Android.Support.v7.CardView 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1) / win. Package Xamarin.Android.Support.v7.CardView 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.7171470Z NU1202: Package Xamarin.Android.Support.v7.MediaRouter 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1) / win. Package Xamarin.Android.Support.v7.MediaRouter 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.7221190Z NU1201: Project UserLogin.Android is not compatible with net471 (.NETFramework,Version=v4.7.1) / win-x64. Project UserLogin.Android supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.7278400Z NU1202: Package Xamarin.Android.Support.Design 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1) / win-x64. Package Xamarin.Android.Support.Design 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.7336420Z NU1202: Package Xamarin.Android.Support.v7.AppCompat 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1) / win-x64. Package Xamarin.Android.Support.v7.AppCompat 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.7393870Z NU1202: Package Xamarin.Android.Support.v4 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1) / win-x64. Package Xamarin.Android.Support.v4 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.7451220Z NU1202: Package Xamarin.Android.Support.v7.CardView 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1) / win-x64. Package Xamarin.Android.Support.v7.CardView 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.7509030Z NU1202: Package Xamarin.Android.Support.v7.MediaRouter 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1) / win-x64. Package Xamarin.Android.Support.v7.MediaRouter 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.7565940Z NU1201: Project UserLogin.Android is not compatible with net471 (.NETFramework,Version=v4.7.1) / win-x86. Project UserLogin.Android supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.7622890Z NU1202: Package Xamarin.Android.Support.Design 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1) / win-x86. Package Xamarin.Android.Support.Design 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.7687110Z NU1202: Package Xamarin.Android.Support.v7.AppCompat 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1) / win-x86. Package Xamarin.Android.Support.v7.AppCompat 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.7746930Z NU1202: Package Xamarin.Android.Support.v4 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1) / win-x86. Package Xamarin.Android.Support.v4 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.7802140Z NU1202: Package Xamarin.Android.Support.v7.CardView 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1) / win-x86. Package Xamarin.Android.Support.v7.CardView 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.7856710Z NU1202: Package Xamarin.Android.Support.v7.MediaRouter 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1) / win-x86. Package Xamarin.Android.Support.v7.MediaRouter 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1)

Hyperlink Label text is not showing mouse Hand cursor after hovering on it in Xamarin

$
0
0

I am using CustomRenderer to make the Label text as the hyperlink. With my code Label is showing Underlined and we are using Label.GestureRecognizers to capture the click. But the mouse cursor is not showing Hand after hovering on the hyperlink text.

Below is the code that we are using:

Shared Project:

  • HyperlinkLabel.cs:

    namespace HyperlinkLabelControl
    {
         public class HyperLinkLabel : Label
            {
            }
    }
    
  • MainPage.xaml:

    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 xmlns:local="clr-namespace:HyperlinkLabelControl"
                 x:Class="HyperlinkLabelControl.MainPage">
        <ContentPage.Content>
            <StackLayout>
                <local:HyperlinkLabel Text="MyHyperLinkLabel" >
                    <Label.GestureRecognizers>
                        <TapGestureRecognizer
                            Command="{Binding BindingContext.MyClickedCommand, Source={x:Reference List}}"
                            CommandParameter="{Binding .}" />
                    </Label.GestureRecognizers>
                    </local:HyperlinkLabel>
            </StackLayout>
        </ContentPage.Content>
    </ContentPage>
    

UWP Project:

  • HyperLinkLabelRenderer.cs:

    [assembly: ExportRenderer(typeof(HyperLinkLabel), typeof(HyperLinkLabelRenderer))]
    namespace HyperlinkLabelControl.UWP.Renderers
    {
        public class HyperLinkLabelRenderer : LabelRenderer
        {
            protected override void OnElementChanged(ElementChangedEventArgs<Label> e)
            {
                base.OnElementChanged(e);
                if (Control != null)
                    Control.TextDecorations = TextDecorations.Underline;
            }
        }
    }
    

Please provide the approch with that the Mouse Cursor will show Hand after hovering on Hyperlink Text in Xamarin.

I am Create Custom Check-Box Control in Xamarin this code correct or not

Viewing all 89864 articles
Browse latest View live


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