小编Mat*_*ard的帖子

SwiftUI 向视图添加 -y 偏移量但将视图拉伸到底部

我的代码中有 2 个视图,一个 VStack,然后是一个自定义视图。

我正在向 -75 的第二个视图添加偏移量,以将其移动到第一个视图的顶部。

这是我当前的代码:

Group {
       VStack {
           //First View
           VStack {
               Image("LogoCrest")

                NavigationLink(destination: LocationSearch()) {
                    Text("Find a location")
                    .foregroundColor(Color.white)
                    .bold()
                    .padding()
                }
                .frame(minWidth: 0, maxWidth: .infinity, alignment: Alignment.center)
                .background(Color(red: 81 / 255, green: 175 / 255, blue: 67 / 255))
                .cornerRadius(7)
                .padding()

           }
           .padding(.top, 75)
           .padding(.bottom, 75)
           .frame(minWidth: 0, maxWidth: .infinity, alignment: Alignment.center)
           .background(Color(red: 49 / 255, green: 49 / 255, blue: 49 / 255))

           //Second view
           CircuitList(Circuits: Circuits)
            .offset(y: -75)
           .padding()
       }
     }
    .background(Color(red: …
Run Code Online (Sandbox Code Playgroud)

swiftui

8
推荐指数
1
解决办法
1793
查看次数

Xamarin 在图像周围形成自定义框架形状

我的应用程序中有一个图像,它周围有一个框架,使图像成为一个圆圈。我想要一个自定义的框架形状,但不知道如何获得这个确切的形状。

形状

(请忽略图中的房子,它只是在 Xamarin 中表示图像,我只需要轮廓作为形状)。

我也不要求框架有彩色边框,只有形状。

任何帮助将不胜感激!

这是我现在的 Frame + Image 代码:

<Frame x:Name="PictureFrame" Padding="0" Margin="0" HorizontalOptions="Center" BorderColor="Transparent" WidthRequest="80" HeightRequest="80" HasShadow="False">
    <Image x:Name="Picture" Source="picture" Margin="0,0,0,0" Aspect="AspectFill"/>
</Frame>
Run Code Online (Sandbox Code Playgroud)

xaml xamarin.forms

5
推荐指数
1
解决办法
1068
查看次数

更改 GitHub 构建操作的路径

我有一个 GitHub Action,它使用默认的 Microsoft 模板将 ASP.Net Core 应用程序构建到 Azure 应用服务。

在操作的顶部,您可以声明一些环境变量。我将这些设置如下:

name: Build and deploy ASP.Net Core app to an Azure Web App

env:
  AZURE_WEBAPP_NAME: (redacted)    # set this to the name of your Azure Web App
  AZURE_WEBAPP_PACKAGE_PATH: '.'      # set this to the path to your web app project, defaults to the repository root
  DOTNET_VERSION: '3.0'                 # set this to the .NET Core version to use
Run Code Online (Sandbox Code Playgroud)

我的问题是根文件夹不包含 .csproj 或 .sln 文件。所以这一行是不正确的:AZURE_WEBAPP_PACKAGE_PATH: '.'

我尝试将其更改为AZURE_WEBAPP_PACKAGE_PATH: './FolderName/FolderName'(以及许多其他变体),这是 .csproj 文件所在的位置,但是由于以下错误,构建仍然失败: …

azure-web-app-service github-actions

5
推荐指数
1
解决办法
719
查看次数

打开邮件应用而不创建电子邮件草稿

我有一个应用程序,需要提示用户打开刚刚发送给他们的电子邮件.如果它自动为他们打开电子邮件应用程序,那将是一个很棒的功能.

我目前有此代码可以打开电子邮件应用并创建新的草稿电子邮件:

Device.OpenUri(new Uri("mailto://"));
Run Code Online (Sandbox Code Playgroud)

我需要在没有打开新电子邮件的情况下运行它,只需将它们带到他们的默认邮件应用程序.

c# xamarin.forms

2
推荐指数
1
解决办法
43
查看次数

仅更改所选项目的TabBar文本颜色(Xamarin.Forms iOS)

我正在编写一个有TabBar的应用程序.在iOS上,我想将所选项目的突出显示更改为绿色而不是此默认蓝色.

蓝色标签

我可以在创建TabbedPage时使用这行代码: BarTextColor = Color.FromHex("#27b286");

这会更改我想要的图标颜色,但它也会更改所有选项卡上的文本颜色,而不仅仅是所选选项卡(我希望选定的选项卡文本为绿色).

绿色标签

TabPage代码是:

 NavigationPage.SetHasNavigationBar(this, false);

        if(Device.RuntimePlatform == "iOS")
        {
            BarBackgroundColor = Color.White;
            //BarTextColor = Color.FromHex("#27b286");

            Children.Add(new CoinsPage() { Title = "Coins", Icon = "coins.png" });
            Children.Add(new PortfolioPage() { Title = "Portfolio", Icon = "portfolio.png" });
            Children.Add(new TrendingPage() { Title = "Trending", Icon = "trending.png" });
            Children.Add(new SettingsPage() { Title = "Settings", Icon = "settings.png" });
        }
Run Code Online (Sandbox Code Playgroud)

如何才能使选定的选项卡文本颜色为绿色?

c# xaml ios xamarin.forms

1
推荐指数
1
解决办法
1345
查看次数