You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Multiplatform App macOS端视图异常求助(iOS端显示正常)

问题:SwiftUI跨平台App macOS端显示异常,iOS端正常

我开发的Multiplatform App在macOS端显示存在异常,但在iOS端显示完全正常。

对应的SwiftUI代码如下:

import SwiftUI

struct listsView: View {

@State private var isPresented: Bool = false

var body: some View {
    VStack {
        Button {
            isPresented = true
        } label: {
            VStack {
                Image(systemName: "plus")
                    .font(.system(size: 128))
                Text("Create your first list")
            }
            .foregroundColor(.primary)
        }
        .sheet(isPresented: $isPresented) {
            addNewListView { newListName, colorCode in
                //Save
            }
        }
    }
}

已找到解决方案:只需给Button添加.buttonStyle(.plain)即可解决macOS端的显示异常问题。

内容的提问来源于stack exchange,提问作者Hamza

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.24 15:15:30