Swift ui macos background transparent TextField

后端 未结 2 403
醉话见心
醉话见心 2021-01-15 02:24

As you can see from the image I have a TextField and after list.

The list has a transparent background, I\'m using .listStyle(

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-15 02:53

    You could use on the background Color.white.opacity(0.01) or Color.clear in your case:

         .background(
           RoundedRectangle(cornerRadius: 5)
           .fill(Color.white.opacity(0.01))
         
    

    or

          .background(
            RoundedRectangle(cornerRadius: 5)
            .fill(Color.clear))
       
    

提交回复
热议问题