Skip to content
Rain Hu's Workspace
Go back

[Swift] UI Challenge

Rain Hu

Challenge 1: Card Style

```swift

struct ContentView: View { var body: some View { ZStack { Color(.systemMint) .ignoresSafeArea() VStack(alignment: .leading, spacing: 20.0){ Image(“eva”) .resizable() .aspectRatio(contentMode: .fit) .cornerRadius(15) .padding(.all) HStack { Text(“Eva Hsu”) .font(.largeTitle) .fontWeight(.semibold) .foregroundColor(.black) .padding() Spacer() VStack { HStack { Image(systemName: “star.fill”) Image(systemName: “star.fill”) Image(systemName: “star.fill”) Image(systemName: “star.fill”) Image(systemName: “star.leadinghalf.fill”) } .foregroundColor(.orange) .font(.caption) Text(“(Reviews 240,152)”) } .padding()

            }
            Text("The best girl in the world.")
                .foregroundColor(.primary)
                .padding(.horizontal)
            
            HStack {
                Spacer()
                Image(systemName: "binoculars.fill")
                Image(systemName: "fork.knife")
            }
            .foregroundColor(.gray)
            .font(.caption)
            .padding()
            
        }
        .background(Rectangle()
            .foregroundColor(.white)
            .cornerRadius(15)
            .shadow(radius: 15))
            .padding()
    }
}

}m


Share this post on:

Previous
基於 Ollama 和 LangChain 的 Naive RAG 實作(搭配 streamlit UI)
Next
[IT] React + .Net