AdskiYojeG
AdskiYojeG

Reputation: 31

Looking for assistance in watchOS app layout

I'm stumble on two problems. I'm trying to cnstruct a view which will contain elements placed on full display of the watch (from top to bottom, full-screen). Some watch apps has such views.

Code below shows how to move content to the top+left edge of the display. And there are two problems.

var body: some View {
    ZStack(alignment: .topTrailing) {
        Rectangle().foregroundColor(Color.green)
        
        HStack(spacing: 0) {
            VStack(alignment: .trailing, spacing: 0) {
                Text("Hello World")
                    .padding(.trailing, 20)
                Text("Hello World")
                Text("Hello World")
            }
        }
    }.edgesIgnoringSafeArea(.all)
        .navigationBarHidden(true)
}

As you can see, element Text aligned to the top+trailing with little padding.

By default on the top of display Navigation Bar with Timer are displayed. Modificator '.navigationBarHidden(true)' working and properly hides Navigation Bar, but not a Timer. This is the first problem.

I can't post the image yet.

Second problem: Two warnings are displaying in console while running the app on simulator. And i'm not sure of its meanings. Despite of the warnings simulator is is not crushed.

WatchKit Extension libMobileGestalt utility.c:421: no value found for key 1129072723

WatchKit Extension [default] has no material, defaulting to light aluminum.

My appretiations in advance.

Upvotes: 3

Views: 542

Answers (1)

Fredy
Fredy

Reputation: 2063

For your first problem, you cannot remove the time from the navigation bar. The primary focus for the AW is to tell time, therefore it should always be visible. The only occasions when the time is not visible is when dictating or writing something using the swipe 'keyboard'.

Warnings are not necessarily a problem, you can ignore these (especially the second one)

Upvotes: 1

Related Questions