4

Currently I have this screen in an example app I'm currently developing:

enter image description here

To achieve this view I used the following code using SwiftUI to implement the GUI.

var body: some View {
            TabView(selection: $selectedTabTag) {
                HomeTabView().tabItem({
                    Image("dark_home_icon")
                    Text("Home")

                }).tag(HomeView.homeTab)

                HealthTabView().tabItem({
                    Image("dark_heart_icon")
                    Text("Health")
                }).tag(HomeView.healthTab)
                
                StatsTabView().tabItem({
                    Image("dark_stats_icon")
                    Text("Statistics")
                }).tag(HomeView.statsTab)
                
                EmergencyTabView().tabItem({
                    Image("dark_phone_icon")
                    Text("Emergency")
                }).tag(HomeView.emergencyTab)
            }.accentColor(UIColor.primaryAquaBlue.toColor())
}

The problem is that when running this code in an Iphone 8 or before that do not have a notch and has a bottom button, the titles of the tabview are too close to the bottom part of the phone, they are so close that is difficult to see them and read them, is there a way to increase this margin? I have tried using Spacer or adding a padding to the Tabview but that only adds an empty space or removes space from the tabview instead of adding. Also I have tried adding the padding directly to the text but it wont change.

ravelinx
  • 1,557
  • 4
  • 18
  • 26
  • 4
    It is standard Apple control in standard default layout. If they think it is Ok, then it is Ok. If it is not for you, then create custom tab bar with padding as you wish. – Asperi Jun 21 '20 at 05:48

0 Answers0