xamarin.forms

Xamarin.Forms - Open file with default app

和自甴很熟 提交于 2021-01-29 17:48:41
问题 I need to open a file from storage. I used Launcher.OpenAsync() , but it always tries to open the file in PDF reader. Is there any other way to open a file with default app on Android? This is the code I have already tried. private void OpenDocument(string filePath) { var localFile = "file://" + filePath; Launcher.OpenAsync(localFile); } 回答1: string path = "yuor uri bla-bla-bla"; await Launcher.OpenAsync(new OpenFileRequest { File = new ReadOnlyFile(path) }); 回答2: //Dictionary with extensions

Bindable property at ContentPage level

牧云@^-^@ 提交于 2021-01-29 17:43:59
问题 I have a ContentPage where I've created a bindable property, so that I can pass some info from the ViewModel to the class that implements the ContentPage. To make it clearer, the code behind class has new bindable property (ConnectionSettingsEnabled) defined: public partial class ConnectionSettingsPage : ContentPage { public static readonly BindableProperty ConnectionSettingsEnabledProperty = BindableProperty.Create(nameof(ConnectionSettingsEnabled), typeof(bool), typeof

Move buttons on the bottom and give more space for editor

独自空忆成欢 提交于 2021-01-29 17:24:58
问题 I am struggling with two things in xamarin forms layout . As shown on the picture i need to make more space for edidor control (highlited as 1) as this will be the place for user's comment. I would like to extend it to the right (max width). Second thing is i need to move buttons to the bottom which i thought i could solve that by settiung VerticalOptions="End" in the <Grid Grid.Row ="4" (higlighted as 2). How can i solve both things up? Below also full xaml code. Xaml: <?xml version="1.0"

How to Deserializing JSON Object Array with Xamarin forms

↘锁芯ラ 提交于 2021-01-29 14:48:33
问题 I am trying to convert this json array to show data in the list view. But i getting this error when i parsing this. Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Collections.Generic.List`1[Apps.Models.RootObject]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly. To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type

I tried to install Xamarin.Android.Support.v4 on Xamarin Project.But it shows errors

若如初见. 提交于 2021-01-29 14:34:35
问题 Severity Code Description Project File Line Suppression State Error Could not install package 'Xamarin.Android.Support.v4 28.0.0.3'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile78', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author. 回答1: If Manage Packages is for Forms project , can not install Xamarin.Android

WebView in ios open as desktop mode

旧城冷巷雨未停 提交于 2021-01-29 14:26:54
问题 I use Xamarin WebView to open a site, site is using responsive design. On Android the site fills the page and work correctly Android Picture . My Problem in IOS it appears as it open in desktop not in mobile mode IOS Picture, after more searched i found WKWebView not use ScaleToFitPage Like UIWebView I try this code but not change anything WKWebView didn't equivalent for UIWebView's scalesPageToFit can anyone help me about that i stuck in that problem from week i didn't find solution till now

How to flip Camera used by ZXing in Xamaring Forms

空扰寡人 提交于 2021-01-29 14:14:04
问题 As part of the app i'm developing i want the ability to change between using the front or back camera, but from my searches and attempts i haven't been able to get it to work using the front camera. The scanner view doing the scanning is the one from ZXing.Net.Mobile.Forms called ZXingScannerView, defined in my xaml like so, together with the button that should do the flipping of the camera. <elements:AdvancedTabbedPage ... xmlns:elements="clr-namespace:Wolf.Utility.Main.Xamarin.Elements

Actionsheet with arrow using Xamarin

随声附和 提交于 2021-01-29 14:08:23
问题 I want to show Actionsheet with an arrow in my iPad app. I need this arrow to be displayed at a different position (may be based on the object being tapped) 回答1: I've done it before using with Rg.Plugins.Popup. I created a frame and added a triangular image below the frame. https://github.com/rotorgames/Rg.Plugins.Popup 来源: https://stackoverflow.com/questions/58945863/actionsheet-with-arrow-using-xamarin

Error when deploying Xamarin.Forms iOS App with XAML Hot Restart

烈酒焚心 提交于 2021-01-29 13:35:47
问题 I am trying to use Xamarin.Forms with Hot Restart to develop an iOS App, but I keep get the following error when running the app from Visual Studio: An error occurred while trying to deploy the app 'TestApp2.iOS.app'. Details: Error running hotrestart: 'An error occurred while deploying the application 'TestApp2.iOS.app' into 'iPhone'. Details: Could not write content to file 'PublicStaging/com.companyname.TestApp2'. ErrorCode: EmptyResponse'. Command: 'deploy -u=00000XXX-001D4C6XXXXXXXXX -i

LaunchScreen IOS Xamarin Forms Not Showing

跟風遠走 提交于 2021-01-29 13:10:18
问题 I followed some tutorials on how to display my launch screen on ios. but it is still not showing. what I am missing?. All I see is the default blue screen. https://docs.microsoft.com/en-us/xamarin/ios/app-fundamentals/images-icons/launch-screens?tabs=macos This is what I have 回答1: What you did is enough to change the LaunchScreen of a Xamarin.iOS app. The steps are: 1.Create a new LaunchScreen1.Storyboard and add your custom view there. 2.Change the Launch Screen option in info.plist as you