How to make the GroupBox look like the reminder in iPhone

            VStack {

                Form {

                    

                HStack{

                        GroupBox(label: Image(systemName: "trash.circle.fill").resizable().frame(width: 25, height: 25)) {

                            VStack(alignment: .leading){

                                Text("kk")

                                    .bold()

                                    .padding(EdgeInsets(top: 10, leading: 0, bottom: 0, trailing: 15))

                                    .padding(.horizontal, -65)

                            }

                        }

                        .padding(EdgeInsets(top: 0, leading: 0, bottom: 15, trailing: 5))

                        .frame(width: 160, height: 100)

                        GroupBox(label: Image(systemName: "trash.circle.fill").resizable().frame(width: 25, height: 25)) {

                            VStack(alignment: .leading){

                                Text("kk")

                                    .bold()

                                    .padding(EdgeInsets(top: 10, leading: 0, bottom: 0, trailing: 15))

                                    .padding(.horizontal, -65)

                            }

                        }

                        .padding(EdgeInsets(top: 0, leading: 0, bottom: 15, trailing: 5))

                        .frame(width: 160, height: 50)

                    }

                    HStack{

                        GroupBox(label: Image(systemName: "trash.circle.fill").resizable().frame(width: 25, height: 25)) {

                            VStack(alignment: .leading){

                                Text("kk")

                                    .bold()

                                    .padding(EdgeInsets(top: 10, leading: 0, bottom: 0, trailing: 15))

                                    .padding(.horizontal, -65)

                            }

                        }

                        .padding(EdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 5))

                        .frame(width: 160, height: 50)

                        GroupBox(label: Image(systemName: "trash.circle.fill").resizable().frame(width: 25, height: 25)) {

                            VStack(alignment: .leading){

                                Text("kk")

                                    .bold()

                                    .padding(EdgeInsets(top: 10, leading: 0, bottom: 0, trailing: 15))

                                    .padding(.horizontal, -65)

                            }

                        }

                        .padding(EdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 5))

                        .frame(width: 160, height: 50)

                    }.padding(30)

                    

                

                    Section{

                        ForEach(itemStore.items) { item in

                            NavigationLink(destination: ItemDetailView(item: item)) {

                                Text(item.title)

                            }

                        }.onDelete { indexSet in

                            self.itemStore.items.remove(atOffsets: indexSet)

                        }

                    }

                }

            }

I want to make a view like the reminder in iphone like this

Answered by Claude31 in 741852022

Is it what you want to achieve ?

If so:

        HStack {
            GroupBox(label: Image(systemName: "trash.circle.fill").resizable().frame(width: 25, height: 25).foregroundColor(.blue)) {
                VStack(alignment: .leading){
                    Text("One")
                        .foregroundColor(.gray)
                        .bold()
                        .padding(EdgeInsets(top: 10, leading: 0, bottom: 0, trailing: 15))
                        .padding(.horizontal, -65)
                }
            }
            .padding(EdgeInsets(top: 0, leading: 0, bottom: 15, trailing: 5))
            .frame(width: 160, height: 100)
            .backgroundStyle(Color(red: 0.1, green: 0.1, blue: 0.1))

            GroupBox(label: Image(systemName: "trash.circle.fill").resizable().frame(width: 25, height: 25).foregroundColor(.red)) {
                VStack(alignment: .leading){
                    Text("Two")
                        .foregroundColor(.gray)
                        .bold()
                        .padding(EdgeInsets(top: 10, leading: 0, bottom: 0, trailing: 15))
                        .padding(.horizontal, -65)
                }
            }
            .padding(EdgeInsets(top: 0, leading: 0, bottom: 15, trailing: 5))
            .frame(width: 160, height: 50)
            .backgroundStyle(Color(red: 0.1, green: 0.1, blue: 0.1))
        }
        
        HStack {
            GroupBox(label: Image(systemName: "trash.circle.fill").resizable().frame(width: 25, height: 25).foregroundColor(.yellow)) {
                VStack(alignment: .leading){
                    Text("Three")
                        .foregroundColor(.gray)
                        .bold()
                        .padding(EdgeInsets(top: 10, leading: 0, bottom: 0, trailing: 15))
                        .padding(.horizontal, -65)
                }
            }
            .padding(EdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 5))
            .frame(width: 160, height: 50)
            .backgroundStyle(Color(red: 0.1, green: 0.1, blue: 0.1))
            
            GroupBox(label: Image(systemName: "trash.circle.fill").resizable().frame(width: 25, height: 25).foregroundColor(.gray)) {
                VStack(alignment: .leading){
                    Text("Four")
                        .foregroundColor(.gray)
                        .bold()
                        .padding(EdgeInsets(top: 10, leading: 0, bottom: 0, trailing: 15))
                        .padding(.horizontal, -65)
                }
                
            }
            .padding(EdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 5))
            .frame(width: 160, height: 50)
            .backgroundStyle(Color(red: 0.1, green: 0.1, blue: 0.1))
        }
        .padding(30)

What do you want to change ? Only groupBox ?

To change what ?

  • color
  • add more items
  • change fonts

Please be more explicit.

Accepted Answer

Is it what you want to achieve ?

If so:

        HStack {
            GroupBox(label: Image(systemName: "trash.circle.fill").resizable().frame(width: 25, height: 25).foregroundColor(.blue)) {
                VStack(alignment: .leading){
                    Text("One")
                        .foregroundColor(.gray)
                        .bold()
                        .padding(EdgeInsets(top: 10, leading: 0, bottom: 0, trailing: 15))
                        .padding(.horizontal, -65)
                }
            }
            .padding(EdgeInsets(top: 0, leading: 0, bottom: 15, trailing: 5))
            .frame(width: 160, height: 100)
            .backgroundStyle(Color(red: 0.1, green: 0.1, blue: 0.1))

            GroupBox(label: Image(systemName: "trash.circle.fill").resizable().frame(width: 25, height: 25).foregroundColor(.red)) {
                VStack(alignment: .leading){
                    Text("Two")
                        .foregroundColor(.gray)
                        .bold()
                        .padding(EdgeInsets(top: 10, leading: 0, bottom: 0, trailing: 15))
                        .padding(.horizontal, -65)
                }
            }
            .padding(EdgeInsets(top: 0, leading: 0, bottom: 15, trailing: 5))
            .frame(width: 160, height: 50)
            .backgroundStyle(Color(red: 0.1, green: 0.1, blue: 0.1))
        }
        
        HStack {
            GroupBox(label: Image(systemName: "trash.circle.fill").resizable().frame(width: 25, height: 25).foregroundColor(.yellow)) {
                VStack(alignment: .leading){
                    Text("Three")
                        .foregroundColor(.gray)
                        .bold()
                        .padding(EdgeInsets(top: 10, leading: 0, bottom: 0, trailing: 15))
                        .padding(.horizontal, -65)
                }
            }
            .padding(EdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 5))
            .frame(width: 160, height: 50)
            .backgroundStyle(Color(red: 0.1, green: 0.1, blue: 0.1))
            
            GroupBox(label: Image(systemName: "trash.circle.fill").resizable().frame(width: 25, height: 25).foregroundColor(.gray)) {
                VStack(alignment: .leading){
                    Text("Four")
                        .foregroundColor(.gray)
                        .bold()
                        .padding(EdgeInsets(top: 10, leading: 0, bottom: 0, trailing: 15))
                        .padding(.horizontal, -65)
                }
                
            }
            .padding(EdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 5))
            .frame(width: 160, height: 50)
            .backgroundStyle(Color(red: 0.1, green: 0.1, blue: 0.1))
        }
        .padding(30)
How to make the GroupBox look like the reminder in iPhone
 
 
Q