xamarin.forms

Customizing a Progress Bar appearance in Xamarin.Forms

拥有回忆 提交于 2020-08-22 09:58:45
问题 I used Drawable to customize the rendering of the ProgressBar in Android as answered to this question but the solution is not working with iOS. Below is how it renders in Android . Below is how it renders in iOS Below is the code for my iOS CustomRenderer [assembly: ExportRenderer(typeof(CustomProgressbar), typeof(CustomProgressBarRenderer))] namespace Demo.iOS.Renderers { public class CustomProgressBarRenderer : ProgressBarRenderer { protected override void OnElementChanged

Customizing a Progress Bar appearance in Xamarin.Forms

拜拜、爱过 提交于 2020-08-22 09:58:12
问题 I used Drawable to customize the rendering of the ProgressBar in Android as answered to this question but the solution is not working with iOS. Below is how it renders in Android . Below is how it renders in iOS Below is the code for my iOS CustomRenderer [assembly: ExportRenderer(typeof(CustomProgressbar), typeof(CustomProgressBarRenderer))] namespace Demo.iOS.Renderers { public class CustomProgressBarRenderer : ProgressBarRenderer { protected override void OnElementChanged

Xamarin.Forms 选取文件 让用户选择本地文件

北慕城南 提交于 2020-08-14 14:47:35
在 Xamarin 中,使用文件存储或打开某个特定文件都是很常用的做法,而在跨平台中,每个平台都有自己的 IO 的坑。如何在 Xamarin.Froms 里面让用户可以选择打开哪个本文文件,需要照顾多个不同的平台的文件访问方式 在 Xamarin.Forms 右击管理 NuGet 程序包,搜寻 Xamarin.Plugin.FilePicker 进行安装,或在 csproj 上添加下面代码 <PackageReference Include="Xamarin.Plugin.FilePicker" Version="2.1.36-beta" /> 如果不是让用户选取文件内容,那么在 Xamarin.Essentials 这个提供了 Xamarin 原生 API 交互的库就完全足够使用了 在界面上添加一个按钮,用来让用户选取文件内容 <StackLayout> <Label x:Name="FileText" Margin="10,10,10,10"></Label> <Button HorizontalOptions="Center" Text="选取文件" Clicked="Button_OnClicked"></Button> </StackLayout> 在后台代码添加按钮点击时让用户选择文件的代码 using Plugin.FilePicker; private async

Xamarin 解决创建空白项目编译提示 linking references 找不到资源

主宰稳场 提交于 2020-08-13 08:37:53
在新建一个 Xamarin 应用,编译时提示了 linking references 和一些诡异的文件无法访问,原因是文件路径问题和 NuGet 还原问题 如果创建的 Xamarin 项目所在的文件路径比较深,同时包含中文等字符时,在编译时可以会诡异失败 oid\Xamarin.Android.Aapt2.targets(155,3): error APT2062: failed linking references. 或者 error APT0000: resource integer/google_play_services_version (aka com.softoursistemas.rutesc.droid:integer/google_play_services_version) not found 也有比较明确的提示 Failed to create JavaTypeInfo for class: Android.Support.V13.View.Inputmethod.InputConnectionCompat/IOnCommitContentListenerImplementor due to MAX_PATH: System.IO.DirectoryNotFoundException: 未能找到路径“g:\lindexi

dotnet Multi-platform App UI 多平台应用 UI 框架简介

我只是一个虾纸丫 提交于 2020-08-12 04:42:38
现在可以使用 .NET 构建一切应用。富有生产力的 .NET 是当前数百万的开发者选择这个平台的理由。在 .NET 5 微软统一了整个 .NET 平台,将 .NET Core 和 Mono 以及基于 Mono 的 Xamarin 放在一起,于是就可以使用相同的一个 BCL 基础库和 SDK 工具链 当咱在考虑如何在 .NET 上构建一个跨平台应用的时候,需要关注的设备和系统包括 Windows 系统和设备和 Android 和 iOS 和 macOS 等。为了满足多平台开发的需求,微软改名部推出了一个新的 UI 框架叫 .NET Multi-platform App UI 简称 .NET MAUI 框架 让我们向您介绍 .NET MAUI 是什么,如何做到延续单个技术栈的经验,使用现代的开发模式,以及这项技术未来的发展趋势 什么是 .NET MAUI 框架 其实 .NET MAUI 是延续具有 6 年历史的 Xamarin.Forms 工具包的框架,可以理解为这个动作是改名部大法的行为。很多年以来,都有很多商业公司,如这个链接 https://dotnet.microsoft.com/apps/xamarin/customers 列举出来的公司,都在使用 Xamarin 用 .NET 来构建自己的业务,这对于 .NET MAUI 来说是一个特别好的开始。它在帮助小型企业最大化其

Transparent background of WebView in Xamarin.Forms (Portable)

眉间皱痕 提交于 2020-08-11 07:35:11
问题 I am able to play GIF image in Xamarin.Forms (Portable) but now I need to remove the background of the WebView. So, that it will look pretty good. Here is the link for the GIF player in Xamarin.Forms (Portable) 回答1: As Yuri S already mentioned, you shouldn't be using the WebView. It's an overkill for such a simple task as showing a GIF animation. Instead, you should look at the GifImageView control by James Montenegro. It extends the default Image control with GIF capabilities using custom

Transparent background of WebView in Xamarin.Forms (Portable)

*爱你&永不变心* 提交于 2020-08-11 07:33:29
问题 I am able to play GIF image in Xamarin.Forms (Portable) but now I need to remove the background of the WebView. So, that it will look pretty good. Here is the link for the GIF player in Xamarin.Forms (Portable) 回答1: As Yuri S already mentioned, you shouldn't be using the WebView. It's an overkill for such a simple task as showing a GIF animation. Instead, you should look at the GifImageView control by James Montenegro. It extends the default Image control with GIF capabilities using custom

[翻译] .NET 官宣跨平台 UI 框架 MAUI

☆樱花仙子☆ 提交于 2020-08-11 04:52:57
MAUI Build 2020 大会上,微软终于正式公布 .NET 上的跨平台框架,正式版将在 .NET 6 和大家见面。 MAUI 是日益流行的 Xamarin.Forms 的进化,Xamarin.Forms 已经有6年历史了。 多年来,UPS,Ernst&Young 和 Delta 等公司一直在利用 .NET 上的 Xamarin 来推动其业务发展。它在帮助小型企业最大化其 95% 以上代码共享的开发投资并击败竞争对手进入市场方面也非常成功。 MAUI 将这一成功扩展到移动设备上,使其包含桌面设备,这是跨两者构建多平台应用程序的最佳方法,尤其是新设备(例如新的Surface Duo)。 MAUI 简化了.NET开发人员的选择,提供了一个堆栈来支持所有现代工作负载:Android,iOS,macOS 和 Windows。 每个平台和 UI 控件的本机功能都可以通过一个简单的跨平台 API 触手可及,您可以在提供不妥协的用户体验的同时共享比以前更多的代码。 单一项目开发体验 MAUI 的构建考虑了开发人员的生产力,包括开发人员需要的项目系统和跨平台工具。MAUI 将项目结构简化为一个针对多个平台的项目,这意味着您只需单击一下鼠标,便可以轻松地将其部署到所需的任何目标,包括台式机,仿真器,模拟器或物理设备。 使用内置的跨平台资源,您可以将任何图像,字体或翻译文件添加到单个项目中,并且

I'm having trouble with Data Binding in Xamarin.forms

倖福魔咒の 提交于 2020-08-10 19:21:37
问题 For a bit of context, I am trying to link my View to my ViewModel. I have a JSON array of Objects, and another of strings in my model. I want to display these objects in my view, however I am having trouble doing so. My Model: namespace Timetabler.Models { public partial class Timetable { [JsonProperty("id")] public long Id { get; set; } [JsonProperty("nid")] public long Nid { get; set; } [JsonProperty("iid")] public long Iid { get; set; } [JsonProperty("lid")] public long Lid { get; set; }

How to read incoming MMS and SMS messages on Android

非 Y 不嫁゛ 提交于 2020-08-10 19:15:15
问题 I know this is a big topic, as seen here and here, so I just wanted to post how I solved both the issue of receiving incoming MMS and SMS messages and the issue of grabbing data from those MMS and SMS messages on Android 9.0 version 28+ using Xamarin.Forms. This code can easily be translated to Java. Here is the completed Android app so you can try it yourself. It also shows how to do some Azure machine learning if you're interested in that. For Broadcast Receivers: Classes, registering class