40 questions
0
votes
3
answers
2k
views
How to make a Liquid Glass Next button as a Circle?
I'm trying to create a Next button (as a right chevron) in the toolbar that looks identical to the iOS 26 back button (with the left chevron) in the new Liquid Glass style. But all my solutions ...
2
votes
1
answer
67
views
How to set which toolbar item not to be compacted when space is narrow?
I have implemented a toolbar with the following code:
import SwiftUI
struct ContentView: View {
@State var selectedTab = "Node"
@State var searchText = ""
...
0
votes
1
answer
62
views
Control the height of a toolbar (accessoryBar) on macOS
I'm trying to control the height of an accessoryBar of a toolbar to have my buttons fully shown.
I use ToolbarItemGroup(placement: .accessoryBar(id: "myAccessoryBar")), which places my ...
1
vote
1
answer
933
views
Search bar occupying all available space on toolbar - macOS 26
I have two views with .searchable modifier and different placements. In both cases the search bar takes a humongous space in the toolbar, thing that doesn't happen in other apps (Apple native ones, ...
2
votes
2
answers
1k
views
Cannot see DefaultToolbarItem in iOS 26 beta 1 in SwiftUI
I can't wrap my head around DefaultToolbarItem in SwiftUI on iOS 26 Beta 1. I use the following code and cannot see it. My code is below the image. Has anybody gotten it to work?
Thanks!
The code ...
0
votes
0
answers
28
views
SwiftUI keyboard toolBar hides for search field [duplicate]
In the below List I am able to see the keyboard toolbar for TextField but when I move to Search text field it disappears.
Is the toolbar not supposed to be shown by SwiftUI or there is something I am ...
1
vote
1
answer
120
views
How do some SwiftUI modifiers modify higher level views?
Most SwiftUI modifiers modify the views beneath them in the hierarchy, but some modifiers modify views above them in the hierarchy. In my example below .navigationTitle, .toolbar, and ....
2
votes
3
answers
674
views
How do I create flexible width ToolBarItems in a SwiftUI Toolbar?
NOTE:
This question pertains to Toolbar on macOS, not iOS.
Context
A common app idiom is a "status area" in the toolbar of an NSWindow. For example, the status box in Xcode or the address ...
1
vote
0
answers
120
views
toolbar(.hidden) not working when navigate while searching is active
Well Im just creating a personal project and then I face this bug. My navigation looks like this, if you compile the code and then try to navigate while you are not searching the .toolbar(.hidden) is ...
2
votes
1
answer
165
views
SwiftUI Keyboard toolbar not visible when the TextField is hosted inside a UIKit SplitViewController
I am hosting a SwiftUI View which contains a TextField and Toolbar to be displayed above the keyboard inside the Detail View of UIKit SplitViewController. When the textfield is pressed, the keyboard ...
0
votes
0
answers
151
views
How to Customize the Timing of NavigationBar Title Display in SwiftUI
I am looking for a way to customize the display timing of the navigation bar’s title in SwiftUI based on the content.
Specifically, I would like to control when the title appears or disappears as the ...
1
vote
1
answer
154
views
SwiftUI, screen rotation breaks the toolbar layout
In SwiftUI I have a simple custom toolbar with a Text:
import SwiftUI
struct ContentView: View {
var body: some View {
NavigationStack {
VStack {
Text("...
2
votes
1
answer
132
views
NavigationStack clipping contents of .toolbar modifier
When using a custom .toolbar within a NavigationStack, the contents of the toolbar are getting clipped on navigation-pop. The code below first renders the view as expected (without any clipping). But ...
2
votes
1
answer
302
views
NavigationLinks don't open with List with selection inside NavigationStack. Show Toolbar between views inside NavigationStack
I use in my Swift UI application for iOS NavigationViews (as .stack). Also I use nested NavigationView inside NavigationView and everything looked as I needed. But I decied to fefuse to use deprecated ...
0
votes
1
answer
416
views
Is there a way to hide a toolbar in Swift without causing Views to shift?
Please bear with me on this question as I am still learning iOS development using Swift.
I currently have an app where the ContentView is a MapView with a clear toolbar at the top. The toolbar has a ...
-1
votes
1
answer
132
views
SwiftUI have "Rounded Rectangle" in toolbar
How can I achieve an effect similar to a rounded rectangle in the swiftui toolbar in order to put some basic buttons there? I have seen the effect in Xcode and other programs that have probably been ...
0
votes
1
answer
243
views
TabView child views don't support ToolbarItem and NavigationTitle
I have some issues with child views inside TabView.
This is my parent view:
var body: some View {
NavigationStack {
VStack(alignment: .leading) {
TabView {
...
0
votes
1
answer
475
views
How to ignore the horizontal safe area of the keyboard toolbar?
I use ToolbarItem(placement: .keyboard) to provide a button over the keyboard. However, it cannot achieve the full screen of the iPhone in landscape orientation. As shown in the screenshot below, it ...
0
votes
1
answer
126
views
How to hide navigation toolbar in SwiftUI using a tabview setup
When I initially run the application, I have the add button present on the first tab, on the second tab, the add button shouldnt be visible but when I tab back to the first tab, the button is gone. ...
0
votes
1
answer
493
views
My build fails when putting a Menu in ToolbarItem
I'm using a NavigationStack for an app view with three ToolbarItems. The last one is supposed to be a straight forward options menu:
NavigationStack {
// CONTENT
.toolbar {
ToolbarItem(...
0
votes
1
answer
114
views
Is there a way to keep animated swiping with TabView (.page) and transparent toolbar at the same time?
I want to keep animated swiping (.page) and toolbar transparency together.
Here is my code with toolbar transparency:
struct TestView: View {
@State private var tabSelection = 1
var body:...
0
votes
1
answer
850
views
How to hide a swiftui ToolBarItem when List is in edit mode?
I have a simple List inside a navigation stack with a toolbar. The toolbar contains an edit button and a "Finished" button to dismiss the view. How do I hide the "Finished" ...
5
votes
1
answer
692
views
Navigation toolbar item appearing after a millisecond when I navigate from UIKit to SwiftUI view
This is what my simplified SwiftUI view looks like:
struct NotificationsView: View {
var body: some View {
if #available(iOS 16.0, *) {
notificationsView.toolbarRole(....
0
votes
0
answers
133
views
Add space between NavigationStack toolbar and other elements
I am trying to add space between the yellow toolbar and the MiniView element below. When I add space, it looks like it extends the toolbar.
The space needs to be similar to the space between the ...
0
votes
3
answers
785
views
How to add space between NavigationStack elements and NavigationStack toolbar
What: add space between the list inside a Navigation Stack and the toolbar on top.
Current code is like this
struct ContentView: View {
let words = ["Hello", "World", "...
0
votes
2
answers
481
views
SwiftUI - Missing Toolbar Button
The following sample code illustrates an issue I am having with my SwiftUI app:
import SwiftUI
struct ContentView: View {
var body: some View {
NavigationView {
Text("...
0
votes
1
answer
855
views
toolbar animation on extending search bar does not work swiftui
I want to animate the extending search bar. When I press the search button, I want to extend the search bar to left, and when I close the search text field, to collapse to right.
...
0
votes
1
answer
68
views
How to display the menu uncollapsed on navigationBar?
I want to display a picker with several options to choose one of them. I could do it but the problem is that the menu shows collapsed.
How can I show the menu display uncollapsed?
Example Code:
...
2
votes
1
answer
290
views
SwiftUI Toolbar bottombar background color will not change
I'm trying to change the color of my toolbar.
I found the code
.toolbarBackground(Color.blue, for: .navigationBar)
and tried to place it in different position in my code but without any success.
...
1
vote
1
answer
665
views
How to create a custom toolbar?
I want to have a sticky toolbar that has multiple different filtering options above a List in SwiftUI. Is there a way to just place a full custom view inside the .toolbar property of a List?
With the ...
4
votes
2
answers
2k
views
Present sheet with a TextField and its keyboard in a single animation?
I'm building a SwiftUI to-do app. You tap an Add button that pulls up a partial-height sheet where you can enter and save a new to-do. The Add sheet's input (TextField) should be focused when the ...
3
votes
1
answer
913
views
How to switch between tabBar and toolbar swiftUI?
In the files App after you pressed the Select button the tabBar switch to the toolbar.
How can I do this with swiftUI?(Switch between tabBar and toolbar)
struct tabBar: View {
var body: some ...
8
votes
0
answers
7k
views
Increase height of toolbar
Is there a way to increase the height of the SwiftUI toolbar? My toolbar items are quite squished together and if I add any padding then they are cut off from the view.
What I have done is created an ...
0
votes
0
answers
244
views
How to create a new toolbar navigation link on each new view and link back to previous view?
Need to create a new toolbar navigation link on each new view going to the next item in the array and back button going to previous item. Currently, it doesn't do that and keeps creating a new toolbar ...
1
vote
2
answers
2k
views
SwiftUI: Logout and switch screens from a popover
In my app, I have a View which is set to either a login View or a home TabView, depending on if the user is logged in. From the TabView, the user can go to a profile popover and logout. I want to ...
0
votes
1
answer
348
views
Toolbar disappears when StackNavigationViewStyle on iPad | SwiftUI iOS 15
I have this TabView:
ZStack(alignment: Alignment(horizontal: .center, vertical: .bottom)){
TabView(selection: $mainViewProperties.currentView) {
...
...
6
votes
1
answer
1k
views
Toolbar jumping in place when view appears
I have a view with a toolbar at the bottom that I am navigating to using a NavigationLink. But when the view appears, the toolbar is shown a little too low. After half a second or so it then suddenly ...
26
votes
10
answers
16k
views
SwiftUI - Adding a keyboard toolbar button for only one TextField adds it for all TextFields
Background
I have two TextFields, one of which has a keyboard type of .decimalPad.
Given that there is no 'Done' button when using a decimal pad keyboard to close it, rather like the return key of the ...
0
votes
2
answers
4k
views
How to set up SwiftUI toolbar to display in the center of the view
I am experimenting with SwiftUI ToolbarItem in various positions in my view, such as in bottomBar and navigation. I am wondering if it is possible to center the ToolBarItem vertically in the view, as ...
2
votes
0
answers
658
views
How to add a keyboard toolbar in SwiftUI that remains even when keyboard not visible
I have a chat app and want to add a toolbar to the keyboard similar to an inputAccessoryView previously prior to SwiftUI.
I know iOS15 now has the option to add a toolbar using the following (from ...