From 23c075a9c27946773feccf05abc90489a6bf5203 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期一, 06 七月 2020 15:58:53 +0800 Subject: [PATCH] 20200706 --- Shared.IOS/Utils/HDLUtils.cs | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 45 insertions(+), 0 deletions(-) diff --git a/Shared.IOS/Utils/HDLUtils.cs b/Shared.IOS/Utils/HDLUtils.cs index ebf00aa..b328699 100644 --- a/Shared.IOS/Utils/HDLUtils.cs +++ b/Shared.IOS/Utils/HDLUtils.cs @@ -11,6 +11,15 @@ public static int RectCornerBottomLeft = 4; public static int RectCornerBottomRight = 8; + /// <summary> + /// 鍏ㄥ眬鎵撳嵃 + /// </summary> + public static void WriteLine(object mes) + { +#if DEBUG + Console.WriteLine (mes); +#endif + } public static void RestartApp() { @@ -21,6 +30,18 @@ } + public static UIColor GetUIColorWithUint(uint uintColor) + { + + byte r, g, b, a; + r = (byte)(uintColor / 256 / 256 % 256); + g = (byte)(uintColor / 256 % 256); + b = (byte)(uintColor % 256); + a = (byte)(uintColor / 256 / 256 / 256 % 256); + + return UIKit.UIColor.FromRGBA(r, g, b, a); + } + /// <summary> /// 鐢熸垚浜岀淮鐮� /// </summary> @@ -31,5 +52,29 @@ return null; } + /// <summary> + /// 璺宠浆鎵撳紑APP鎴栬�匒pp Store涓嬭浇鍦板潃 + /// </summary> + /// <param name="url"></param> + public static void OpenUrl(string url) + { + UIApplication.SharedApplication.OpenUrl(new Foundation.NSUrl(url)); + } + + /// <summary> + /// 璺宠浆鎵撳紑APP + /// </summary> + /// <param name="url"></param> + public static bool OpenApp(string url) + { + //鎵撳紑鐨勭洰鏍嘇pp锛屾病璁剧疆鐧藉悕鍗� 鎴栬�� 娌″畨瑁呯殑浼氭墦寮�澶辫触CanOpenUrl 杩斿洖false + if (UIApplication.SharedApplication.CanOpenUrl(new Foundation.NSUrl(url))) + { + UIApplication.SharedApplication.OpenUrl(new Foundation.NSUrl(url)); + return true; + } + return false; + } + } } -- Gitblit v1.8.0