添加添加数据库服务器表
修改扫码连接修复扫码闪退问题
This commit is contained in:
1 parent
6c0af56ea9
commit
0801e4875c
64 files changed
+3265
No files matched your search
@@ -0,0 +1,48 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Maui.Handlers;
|
||||
using SunlightAggregationTerminal.Models;
|
||||
using ZXing.Net.Maui.Controls;
|
||||
|
||||
namespace SunlightAggregationTerminal
|
||||
{
|
||||
public static class MauiProgram
|
||||
{
|
||||
public static MauiApp CreateMauiApp()
|
||||
{
|
||||
var builder = MauiApp.CreateBuilder();
|
||||
builder
|
||||
.UseMauiApp<App>()
|
||||
.UseBarcodeReader()
|
||||
.ConfigureFonts(fonts =>
|
||||
{
|
||||
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
|
||||
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
|
||||
})
|
||||
.ConfigureMauiHandlers(handlers =>
|
||||
{
|
||||
// 这里的 "NoUnderline" 是自定义映射名称,可以随意命名
|
||||
EntryHandler.Mapper.AppendToMapping("NoUnderline", (handler, view) =>
|
||||
{
|
||||
#if ANDROID
|
||||
// 将背景 tint 设为透明
|
||||
// 这会移除 Android 默认的下划线颜色
|
||||
handler.PlatformView.BackgroundTintList = Android.Content.Res.ColorStateList.ValueOf(Android.Graphics.Color.Transparent);
|
||||
|
||||
// 如果想彻底移除背景绘制(不仅仅是颜色透明)
|
||||
// handler.PlatformView.Background = null;
|
||||
#endif
|
||||
});
|
||||
});
|
||||
// 将 HttpClient 注册为单例服务
|
||||
builder.Services.AddSingleton<HttpClient>();
|
||||
|
||||
builder.Services.AddSingleton<DataModel>();
|
||||
|
||||
#if DEBUG
|
||||
builder.Logging.AddDebug();
|
||||
#endif
|
||||
|
||||
return builder.Build();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user