226 questions
2
votes
2
answers
203
views
VStack doesn't fully adapt to content's height
I am new to SwiftUI development and I am meeting a strange behavior with the VStack component.
I am building a GUI for a MacOS utility where I intend to present information from several components one ...
-6
votes
1
answer
96
views
How can I decrease the distance between a VStack and a Section in a List View?
List {
VStack(alignment: .leading, spacing: 8) {
}
.frame(maxWidth: .infinity, alignment: .leading)
.padding(.vertical, 0)
.listRowBackground(Color.clear)
// 2. History ...
0
votes
1
answer
32
views
VStack child order change - Animate as movement instead of blending
A VStack shows chil-views created with a ForEach(viewModel.items...) loop. When the order of items changes I would like to animate the movement of items (e.g. two items switching the place).
The ...
2
votes
2
answers
71
views
How to make formula in excel circling
I got 2+ tables and want to stack their data with filter. Each position have mark. Here PN1 and PN2.
For example.
Table 1
Column A
Column B
Column C
Column D
PN1
Ducts
200x200
3
PN2
Ducts
300x300
5
...
3
votes
2
answers
406
views
Excel SORT Function in Conjunction With UNIQUE, TOROW & VSTACK
I need to extract unique values from multiple ranges (only two ranges in my example, but more will be added) and display them in a single row, sorted in ascending order, without duplicates.
So far, I ...
0
votes
2
answers
143
views
How to set HStack child alignment different
I have HStack with two views: Image and Text. I would like to align Image top but the text center on VerticalAlignment. However, specifying alignment .center for the Text does not do the trick , it is ...
2
votes
1
answer
117
views
Which rules does VStack use to allocate space between subviews?
TL;DR Which rules does VStack use to distribute available space between its subviews. especially when maxHeight: .infitiy is involved.
Coming from UIKit and LayoutConstraints I still struggle to get ...
0
votes
2
answers
305
views
EXCEL VSTACK with a calculated SUM
I’ve got a pivot table with names in the rows and dates in the columns. I need to display actual count per name per week so the pivot table needs to look like the following.
I then also need to ...
0
votes
2
answers
213
views
Layout question for a numbered list in SwiftUI
I am working on a NumberedList component which works like the <ol> tag in HTML. I'd like to be able provide an arbitrary number of elements, that would be automatically numbered and laid out. ...
0
votes
0
answers
164
views
Excel: Applying SUBTOTAL() within VSTACK() (for a Sum of a Filtered Column)
INTRODUCTION / DESIRED RESULT
I am trying to create a table that automatically updates and that can be filtered. In this table, I want to add a dynamically column total at the end of the 'time ...
0
votes
1
answer
79
views
Multiple views inside Stack and they resize in SwiftUI
I have VStack which which has multiple views inside it and are of variable height. This VStack is placed inside the UITableView. I need to calculate the height of VStack since it resize and give ...
0
votes
1
answer
69
views
IN EXCEL split connections based on in between points in X,Y locations
I start from an inputlist of points with X,Y locations and an input list of beginning and end points from the first list.
How to get an output list with sub (inbetween) connections if a point is ...
1
vote
4
answers
1k
views
Excel: Dynamic stacking or arrays n-number of times
Problem: Stacking arrays horizontally/vertically n-number of times
Examples:
Horizontal array {"A", "B", "C"} stacked horizontally n=3 times = {"A", "B&...
0
votes
1
answer
541
views
How to align VStack to top of View but under toolbar
I have put in a great deal of effort to find solutions to this before asking my question here in accordance with the rules. Unfortunately, all solutions previously answered have not worked for me. My ...
2
votes
1
answer
760
views
How to dynamically change from HStack to VStack when using LabeledContent?
I am setting up the frame width and wondering if it is possible to have this display as a VStack
value:
title
instead of the default of a HStack when someone increases to a larger font size.
value: ...
0
votes
0
answers
41
views
can't get my navbar to the top, keeps having a space above or stretches
import SwiftUI
struct UtilitySelectionView: View {
var body: some View {
NavigationView {
GeometryReader { geometry in
ZStack {
// ...
0
votes
0
answers
198
views
Calculate height of a dynamic view using GeometryReader at SwiftUi
In my code I need "height" var to be refreshed depending of the size of the view (carousel). I thought that it could be possible by using GeometryReader, but the size is not correct :((
@...
2
votes
2
answers
154
views
SwiftUI: how to make ScrollView take rest of VStack space
I would like to have a VStack with a single view with fixed height on top, and the rest of the VStack taken up by a ScrollView.
The code I am using right now to test this out is shown below. That ...
1
vote
2
answers
651
views
How to create a dynamic VSTACK comprised of arrays formed with MAKEARRAY in Google Sheets [duplicate]
This is probably a simple one but it is eluding me somehow. We are a security company managing access control systems in multi-unit residential buildings.
I have a Google sheet that we give to our ...
0
votes
1
answer
369
views
HStack Center alignment while keeping a VStack leading alignment
I am wanting to display three items across a screen equally. I am trying to make them all centered while having a leading alignment so when there is less than three they still maintain the same look. ...
4
votes
5
answers
1k
views
How do I have achieve a combined line limit for two Text views in a VStack in SwiftUI?
I have a design that I want to achieve in SwiftUI, and there are three examples shown below.
It's a VStack that contains an Image, and two Text views.
It should show no more than three lines of text,...
0
votes
1
answer
318
views
Views overlapping in VStack
I have some data that will be loaded from a server and in the mean time I want to show a shimmer placeholder view.
To achieve the shimmer effect, I've created the following:
struct ShimmerEffectBox: ...
3
votes
3
answers
1k
views
scroll indicator incosistent and stutters with LazyVStack
I use LazyVStack because I need to load a big list of elements, LazyVStack helps with loading fewer elements, hence the scroll bar/indicator does not know the real size of the list, causing ...
0
votes
2
answers
162
views
VStack Not Resizing Properly to ForEach Contents
Consider the following setup (it's not the neatest display, but it was the quickest way I could think of to replicate my problem):
class IdentifiableString: Identifiable, Hashable {
static func ==(...
0
votes
0
answers
88
views
Make VStack fill images proportionally
I'm doing the switch from UIKit to SwiftUI and I'm trying to achieve the following "Collection View".
Assuming I have an array of pairs (i.e: [[<Image0>, <Image1>], <Image2&...
0
votes
2
answers
1k
views
Error Cannot convert value of type 'some View' to expected argument type 'Text'
I have a let txt = "Hello My name is jhon cena, call me +17878 Thank you"
Now requirement is to make tappable phone number & make it bold font.
Here is my code which gives error Cannot ...
0
votes
1
answer
994
views
Why top right & left corner radius not showing up in swiftUI
When I add HeadingView() in code the top left & right corner radius is not showing up
I don't know what is the reason
struct CustomView: View {
var body: some View {
VStack(...
1
vote
1
answer
1k
views
SwiftUI Image Clip to ZStack - Image extends to edges of screen ignoring padding of parent stack
This is my first question on here.
I want padding at the edges of this View:
struct Test3: View {
var body: some View {
VStack {
ZStack {
Color.blue
...
2
votes
1
answer
708
views
VStack Leading alignment doesn't work with nested Text Views
This is how my VStack is defined here:
VStack(alignment: .leading, spacing: 1) {
Text("entry.titleAlert hajdfg dgfhds fghjds gfhjdsg fhjdsg2")
.frame(maxWidth: .infinity)
...
0
votes
2
answers
328
views
Center HStack content excluding content in VStack
I have a pretty basic view with an HStack, that has an Image, VStack, Text, and another Image in it. What I would like for is the speedometer image, the ProgressView (which is in the VStack), the &...
0
votes
1
answer
100
views
ScrollView affecting the Views inside Geometry Reader
Main Content View:
struct ContentView: View {
@State var editing: Bool = false
@State var inputText: String = ""
@State var vOffset: CGFloat = 0
@State var hOffset: ...
0
votes
0
answers
243
views
Place Title and Button at Top and Bottom of Screen in Both Landscape and Portrait Orientation in Swift UI
I am trying to make the jump from Objective-C's graphical UI to coding the UI in Swift.
I have a View that looks okay in portrait mode, but when the device is rotated, the title and buttons move off ...
1
vote
1
answer
555
views
Vstack with merged cells
I want to use the formula vstack on an array to combine columns from different worksheets, it works perfect on column H and beyond but on the columns that have stacked cells(D to G), I got error #...
4
votes
0
answers
236
views
Remove top margin in SwiftUI app for Apple WatchOS
My WatchOS app show a top margin and I don't know why. I'm using a VStack inside the main view, and I expect the title should be aligned top.
How can I remove the top space? The only think I found to ...
0
votes
1
answer
236
views
how to make a blank cell after copy-paste
After a conversion i get an excel file with multiple sheets.
i create a new sheet(1) and with vstack i stack the content from all sheets into the new sheet(1).
all blank cells from the original ...
0
votes
1
answer
412
views
How to align views inside HStack according to view in VStack?
Let's say we have the following code:
struct ContentView: View {
var body: some View {
VStack {
Color.black
.frame(width: 130, height: 30)
...
0
votes
1
answer
697
views
Same Width for views in swiftUI
I have a List and a button in VStack.
The button width needs to be the same as the ListView Width.
How can I make it the same in SwiftUI?
I am just a beginner in swiftUI, so I don't know any modifiers
...
0
votes
1
answer
295
views
VStack inside ScrollView swiftUI
I have view, where inside ScrollView stackView, with content what expand after tap on button, and then I should scroll this page. in the bottom I have HStack with buttons, up there "RatingViews&...
3
votes
2
answers
2k
views
Swift UI LazyVStack with nested VStack
I'm experiencing this issue and not user if it's a swift ui bug or expected behaviour. Could not find something related to this online.
Given this view
struct ContentView: View {
var body: some View ...
3
votes
1
answer
621
views
How to ignore keyboard safe area only for the last view in a VStack?
The keyboard lifts the last view in a VStack.
Adding .ignoresSafeArea(.keyboard) only to BannerAd doesn't work. (Why?)
import SwiftUI
import RealmSwift
struct ContentView: View {
@...
1
vote
1
answer
628
views
SwiftUI VStack alignment guide with other views
I'm struggling to achieve the following custom alignment in a SwiftUI VStack:
I've created a custom alignment guide to use in the Event view, as follows:
extension HorizontalAlignment {
struct ...
-1
votes
1
answer
214
views
How can I measure an item inside of a VStack in SwiftUI?
I am building an app for iOS in Xcode. New with this, as you can see.
I created a VStack, with 3 rectangles in it, all of them taking al the width of the screen (the app is only portrait):
First one ...
0
votes
1
answer
319
views
SwiftUI: VStack Layout with 2 fix size SubVIews and the 3rd subview (in Middle) taking rest of available height
I need to make a screen in SwiftUI where the 1st and 3rd subviews of a VStack have fixed size and I want the 2nd in the middle to take the rest of the available height (This value will differ based on ...
0
votes
1
answer
324
views
VStack with ignoresSafeArea modifier is not centered in ContentView
I have a layout question for using VStack with ignoresSafeArea modifier.
This is my code:
struct ContentView: View {
var body: some View {
VStack{
Color.green
....
3
votes
0
answers
244
views
SwiftUI View Not Updating After Inserting Elements Into Array
I have a SwiftUI View that I am presenting in a UIViewController container. When a user creates a post I want the feed to fetch that new post from the service and insert it at the beginning of the ...
1
vote
1
answer
45
views
Get perfect alignment and content measurements of HStack and VStack
I'm trying to insert 3 rectangles inside my scrollView precisely 2 horizontally and 1 vertically.
I need all three rectangles to respect the same width. Horizontally everything works fine and adapts ...
0
votes
0
answers
167
views
How to create a View where circular profile image is split between two views, where second view has only top right, top left corner radius in swiftUI
I'm learning SwiftUI, and my Profile Screen requires a view similarly shown in this image: https://i.pinimg.com/originals/1c/21/96/1c2196706b947cc9e8f656da98fd2c80.jpg
I have managed to set background ...
0
votes
1
answer
776
views
append numpy arrays in a loop to an empty numpy array
I have an empty numpy array. And I want to append arrays to it such that each appended array becomes an element.
import numpy as np
a = np.array([])
for i in range(3):
a=np.append(a,np.array(['x'...
-3
votes
1
answer
1k
views
Where is the extra padding coming from in my VStack?
I am trying to create a very simple SwiftUI view where I show an image with some text right below it. However, whenever I add a custom image from Assets(system images look fine), there is a little bit ...
0
votes
1
answer
176
views
How to use ffmpeg vstack to have both audio tracks?
I have simplest ever question, which I can't find an answer here. How to vstack and get sound from both videos?
I use simply:
ffmpeg -i e:\tt140_H.mp4 -i e:\tt140_m.mp4 -vsync 2 -filter_complex vstack ...