Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 months ago.
Improve this question
How do I remove this icon?
I am using very simple code; just navigation view
As mentioned in the comments by #Nirav D, this button is used to toggle the sidebar visibility.
iOS 16 & above
In iOS 16, Apple gave Navigation a big refresh:
Introducing NavigationStack(which is probably what you want), it is used to present a view allowing the user to navigate using NavigationLink as you would on an iPhone.
Introducing NavigationSplitView(which is what you’re seing in the simulator right now), it is used to present a menu (sidebar) that can present detail views. You can have up to 3 columns.
Deprecating NavigationView, from now on you have to use the above containers as NavigationView will be obsoleted in a future iOS release.
iOS 15 & below
In versions earlier than 16, you have to use NavigationView. NavigationView accepts navigationViewStyle, the default style on iPhone is StackNavigationViewStyle where the content is presented in one column. However, on iPad in order to maximise the use of screen estate, SwiftUI sets the default style to ColumnNavigationViewStyle that presents the content in columns (Master -> Detail…).
If you mean to use a single column: you must use either NavigationStack or NaigationView with .navigationViewStyle(.stack);
If you have to use multiple columns & still hide the button: use .navigationBarHidden(true) on the sidebar view, or .toolbar(.hidden, for: .navigationBar) for iOS 16+.
For more info, check: Navigation & The SwiftUI cookbook for navigation
Related
I am trying to create the same experience where a sheet is presented in one of the tab items of a TabView - not covering the tabs.
I am using .presentationDetents() and SwiftUI4.0 for that.
See example of Apple's own app doing that
The sheet is covering the child view inside TabView.
However, instead in my own code I am getting
this - the tabs of the parent view are covered by the modal sheet
The link https://developer.apple.com/forums/thread/711702 suggests that it is not possible to achieve the same behaviour you see in Apple's Maps and Find My apps with the current SwiftUI API.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I am a Visual Studio MFC newbie, and have been a bit perplexed by a problem over the last couple of days. When I create a radio button and assign it variable, I get a "Debug Assertion Failed". How should I make the radio button a variable?
You have to make sure that the first radio button in a sequence of radio buttons is of style WS_GROUP. It is a style you can set in the dialog editor by selecting the first radio button and setting its style to Group.
You want to use an int as the type to receive/set and only use DDX_Radio() on the first radio button on the group. It will return 0 if first radio selected, 1 if second, 2 if third, etc... Make sure the value you use, a member variable is initially set to 0 or another valid value.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I have an image 32x32 and I want to fill the whole screen with many images
So I thought I could use ForEach but it doesn't seem to work
ForEach(0..<5) {_ in
Image("myImage")
}
this code creates 5 previews instead of 5 images
The problem is that you need to embed the code inside a Vstack or an Hstack.
That way it will know how to create those images (vertically or horizontally)
Vstack(spacing: 0) {
ForEach(0..<5) {_ in
return Image("myImage")
}
}
You need to use VStack or HStack You can't do that. For more info just take a look on the Apple Documentation. Here in Make the List Dynamic you will get the information.
I have a SwiftUI app in which I would like to show the "WorkOut" and "Activity" icons and launch those apps when the respective icon is tapped.
Is this possible in WatchOS6 & SwiftUI?
I know this "can I launch another app from within my app" question has been asked before for iOS or WatchOS but the answers seem old and I was hoping that this is now possible in WatchOS 6.
Thanks!
Gerard
MKMapItem has a method openInMaps() that you can use to open the Maps app.
I don't think there is an equivalent for the Workout/Activity apps.
Also, I seems like using their icons is against the guidelines. You can only use the rings.
https://developer.apple.com/design/human-interface-guidelines/healthkit/overview/
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
i need to display Product Weight under Product price in the single product page & search page on OpenCart 3.0.2.0 .
How i can do that ?
This is relatively simple if you understand the MVC (Model, View, Controller) pattern. Here are the steps required:
You need to add the logic for fetching the product weight in the controller file and pass it to the view catalog/controller/product/product.php
On line 283 (right after the price because it is a nice place for it) add this code
$data['weight'] = $product_info['weight'] + 0 ;
(the + 0 removes the zeros and makes it looks nicer)
Then you need to display it in your view template file catalog/view/theme/default/template/product/product.twig
on line 162 add:
{{weight}}
If you don't see the changes, that is because you have twig Cache turned on. Go to admin/dashboard and on the top right corner find the gear button. click it and click refresh cache. you can also turn off the cache while you are in development mode. http://joxi.ru/LmGewYZiwBW0zA