.border(Color.blue, width: 3)
}.buttonStyle(PlainButtonStyle())
</pre>
===親Viewのサイズ情報を取得する===
----
*https://qiita.com/masa7351/items/0567969f93cc88d714ac
*https://www.hackingwithswift.com/quick-start/swiftui/how-to-make-two-views-the-same-width-or-height
[[File:swiftui_grid_layout1.png|200px]]
[[File:swiftui_grid_layout2.png|400px]]
<pre>
struct HostView : View {
var host: WoL.Host
var body: some View {
GeometryReader { geo in
HStack() {
Text(host.host)
.padding()
.frame(width: geo.size.width * 0.33 , alignment: .leading)
.frame(maxHeight: .infinity)
.background(Color.red)
Text(host.ip)
.padding()
.frame(width: geo.size.width * 0.33 , alignment: .leading)
.frame(maxHeight: .infinity)
.background(Color.green)
Text(host.macaddr)
.padding()
.frame(width: geo.size.width * 0.33 , alignment: .leading)
.frame(maxHeight: .infinity)
.background(Color.yellow)
}.fixedSize(horizontal: false, vertical: true)
}.frame(height: 60)
}
}
</pre>