I think I found the answer I wanted in "overlay", which allows anchoring additional items within the space of another item, at corners or centered along edges.
//
// MainView.swift
// DB5 Remote
//
// Created by Todd Gillissie on 1/10/22.
//
import SwiftUI
struct MainView: View {
@State private var playingVideoId = ""
@State private var mode = AppMode.MODIFICATIONS
var body: some View {
ZStack {
GeometryReader { geometry in
Image("BackingTexture100")
.resizable()
.aspectRatio(contentMode: .fill)
.scaledToFill()
.ignoresSafeArea()
}
// Top left & right
// VStack
// {
// HStack {
// Image("007LogoWhite")
// .resizable()
// .scaledToFit()
// .frame(width: 120, height: 40, alignment: .topLeading)
// Spacer()
//
// PancakeMenu()
// }
// Spacer()
// }
// .padding(.horizontal, 8)
// Horizontally centered from top to bottom of screen.
VStack
{
Image("MI6logo")
.padding(.bottom, 6.0)
DB5LogoTitle(mode: mode)
// switch statements don't work in views for some reason..
if (mode == AppMode.MODIFICATIONS)
{
ModificationsView()
}
else if (mode == AppMode.VIDEOS)
{
VideoList()
}
else if (mode == AppMode.CREDITS)
{
Rectangle().foregroundColor(.yellow)
}
}
.overlay(alignment: .topLeading) {
Image("007LogoWhite").resizable()
.scaledToFit()
.frame(width: 120, height: 40, alignment: .topLeading)
}
.overlay(alignment: .topTrailing) { PancakeMenu() }
.padding(.horizontal, 8)
if (playingVideoId != "")
{
VStack
{
Spacer()
PlayingVideo()
}
.padding(.horizontal, -4.0)
.ignoresSafeArea()
}
}
}
}
enum AppMode: Int {
case MODIFICATIONS = 0
case VIDEOS = 1
case CREDITS = 2
}
struct MainView_Previews: PreviewProvider {
static var previews: some View {
MainView()
}
}