Skip to main content

All Questions

Filter by
Sorted by
Tagged with
2 votes
2 answers
1k views

UIView hidden is not getting set

I have a UIView subclass that is added as an arranged subview of a UIStackView. Depending on the data in the model, I want to either hide or show the arranged subview (called myView), but the problem ...
ashipma's user avatar
  • 475
0 votes
1 answer
151 views

CAGradientLayer in UILabel in UIStackView

This is a custom UIView subclass for a tableHeaderView. I'm currently trying to put a gradient to an UILabel that's in a vertical UIStackView. It works really well without gradient even in RTL ...
Arainty's user avatar
  • 111
0 votes
1 answer
650 views

How to hide a UIView that doesn't fit in available space?

There is a stack view with 4 elements. Every element has a Horizontal Content Compression Resistance Priority of 1000, except one: A(1000) - B(1000) - C(999) - D(1000) With a lot of space, there is ...
Sergio's user avatar
  • 1,912
1 vote
1 answer
338 views

How to add a responsive UIPageViewController inside an UIStackView programmatically?

I am trying to place an UIPageViewController inside a UIView with no predetermined height. What I am trying to achieve is build a responsive In-app Message that has one or more components (buttons, ...
rgoldenb's user avatar
0 votes
1 answer
511 views

When did UITableViewCell done layout subview?

As shown in the following image, I want to add a tip(subview of the biggest UIView) that left align with the UIStackView in UITableViewCell. The width of UIStackView in UITableViewCell is dynamic, so ...
ArgenBarbie's user avatar
-1 votes
1 answer
1k views

UIStackview keep subviews right align, even if other view is hidden

I have horizontal UIStackview (width = screenwidth height = 40) with 2 buttons. I set width and height of both buttons to 40. The UIStackview Alignment is Fill and Distribution is Equal spacing. Now ...
Ram's user avatar
  • 289
0 votes
1 answer
219 views

stackview in custom table cell

In a custom table cell, I'm trying to hide/show view on a button click. I'm able to achieve this but couldn't able to remove the blank space. How to remove those blank spaces. I used auto constraints ...
Chetan Reddy's user avatar
0 votes
1 answer
28 views

How to adjust stackview with child view and add constarint

I am leaning iOS programming in objective-c. In Xcode, I am trying to add stack view that encompass a table view. However, the storyboard showed some warning or error that indicates I should set ...
Amrmsmb's user avatar
-1 votes
2 answers
54 views

How can you display a list of images as a navigation bar's title?

From stackoverflowing, I understand that to set the title of a navigation bar to an image, we use the following code: UIImage *image = [UIImage imageNamed:@"image.png"]; self.navigationItem.titleView ...
Wallace's user avatar
  • 147
0 votes
1 answer
65 views

Auto Adjustment of UIImageView

I am currently working on UIImageView and I have an API which returns a number of images, maximum =5 and minimum=1, I have to adjust the position of the image based on the response. Suppose I have ...
CloneCreated's user avatar
0 votes
1 answer
64 views

Adding Size Constraints for Views inside a UIStackView

I currently have a UIStackView that I add views to, it fits a maximum of 10 views along with a button. The issue however, is that although the views I add are equal size, the button is not. I have ...
Jatearoon Keene Boondicharern's user avatar
1 vote
1 answer
265 views

Add trailing constraint between two views

I got stuck with a weird behaviour I added programmatically a trailing constraint between 'UISlider' and 'UILabel', it looks like this: NSLayoutConstraint *timeLabelTrailing = [NSLayoutConstraint ...
dudi hisine's user avatar
0 votes
1 answer
2k views

Change height of view programmatically in uistackview

I need to change the view height in the stack view when I press the test button, but it is not working properly. When I press the test button, I want to set the height of view 3 to 50 and the height ...
Emre G.'s user avatar
  • 53
6 votes
2 answers
1k views

UIStackView: Loading views from xib and updating height constraint of subView did not reflecting any changes?

I have the following hierarchy in my application - UIScrollView - UIStackView - UIView 1 // load with xib and added in arrangedSubviews - UIScrollView 1.1 // horizontal scrolling, fixed height ...
iamVishal16's user avatar
  • 1,780
13 votes
3 answers
1k views

How can I disable horizontal scrolling and page will change on click in paging using UIScrollView?

I have a UIScrollView with pagingEnabled. Added 5 UIStackView to subview of UIScrollView and also had one UISegmentedControl. I want to show currently selected segment and also want to disable ...
iamVishal16's user avatar
  • 1,780
5 votes
2 answers
4k views

Replace view inside UIStackView?

I have UIStackView which contains 3 subviews. And it is created via storyboard. What if I need in some cases replace the middle subview with another one? What is the best way to solve this issue ...
Vyachaslav Gerchicov's user avatar
1 vote
1 answer
2k views

Objective-c: Dynamic size of UIStackView, depending of it's content

I have an UIStackView which is inside a scrollview. the content of the stackView is dynamic, depending of how much views created and added with the methode "addArrangedSubview". if I have a few ...
Walid's user avatar
  • 720
0 votes
1 answer
399 views

Inside UIStackView UILabel not word warpped to next line

Below is my screen configured in Xcode storyboard. Inside the stack view, I want the same spacing I did via using stack view, but inside each view, in the stack view the label text is not wrapped to ...
Vijayabalan's user avatar
0 votes
0 answers
45 views

Animating Nested UIStackViews [duplicate]

I'm working on a app with a combined login/signup screen. When the user taps "Sign up" at the bottom, a birth date field and a terms of service checkbox appear below the email and password field so ...
Jake's user avatar
  • 13.7k
1 vote
0 answers
601 views

App crashes when inserting UIButton into UIStackView

I have wired up a UIStackView in my storyboard and I am dynamically adding buttons to it, this works fine if I add one or two buttons but when I want to insert the third button the app crashes with ...
Matt Douhan's user avatar
  • 2,113
0 votes
1 answer
124 views

Multiple XIBs embeded in UIStackViews displayed in one StoryBoard with UIStackViews

I am using multiple XIBs/Storyboards to build my application. I have the views laid out in the XIBs. Some have UIStackView to help organize the layout. My main storyboard has two views embedded in a ...
user-44651's user avatar
  • 4,124
25 votes
5 answers
9k views

Negative spacer for UIBarButtonItem in navigation bar on iOS 11

In iOS 10 and below, there was a way to add a negative spacer to the buttons array in the navigation bar, like so: UIBarButtonItem *negativeSpacer = [[UIBarButtonItem alloc] ...
pckill's user avatar
  • 3,749
10 votes
4 answers
27k views

How to center both vertical and horizontal inside a UIStackView

I have a simple UIImageView with 50x50 size. If I had a UIView of size 100x100 and I wanted to center the image inside of it, all I have to do is set these But how do I do the same with a UIStackView ...
Just a coder's user avatar
  • 16.6k
2 votes
1 answer
3k views

Keep subviews as original dimensions in UIStackView

Currently I'm trying to make 3 buttons in a horizontal group of 3 that have equal spacing UIStackView * menuButtons = [[UIStackView alloc] initWithFrame:CGRectMake(0, 0, 60, 16)]; menuButtons.axis =...
user286152's user avatar
-2 votes
4 answers
2k views

How to access text value from textfield using objective c with tag?

Output imageActually i am new to objective c. My problem is how to fetch text from textfield with tag. Where textfields are located inside nested uistackview. So i am not able to get the value of text ...
Mahaveer Bubanale's user avatar
0 votes
1 answer
577 views

Converting a CGRect from a view to superview not working

I am creating a board game that is based on the chess board. In order to create the board game, I did this: Imagine a chess board divided in 8 columns of white and block squares. I created a XIB to ...
Duck's user avatar
  • 35.9k
-1 votes
2 answers
503 views

How to set a proportional width to subviews in UIStackView(Horizontal)

I'm having 2 views in Horizontal Stack View and the Distribution Style of that is Fill Proportionally. If One view set hidden as TRUE another view occupies all the space but when both the views are ...
Vinoth's user avatar
  • 119
0 votes
0 answers
179 views

Using stackViews in tableViewCell with custom cells

I have a ViewController.It has tableview on it,that tableView has custom cells.I want to hide few rows of custom cells in certain conditions.But I want the tableview to adjust the view automatically ...
Prez's user avatar
  • 227
1 vote
1 answer
574 views

UIStackView: control of spacing

I need to have X number of buttons in a horizontal UIStackView, which resides inside an UIScrollView. The requirement is that the buttons should be evenly distributed in the stack view, and as the ...
Heuristic's user avatar
  • 5,341
4 votes
1 answer
3k views

UIStackView inside UIScrollView: how to center-align stack view / items?

I have a UIStackView inside a UIScrollView, and when the width of all items in stack view is less then the width of the scroll view, I want to make the stack view (or the items) to be horizontally ...
Heuristic's user avatar
  • 5,341
0 votes
1 answer
2k views

UIStackView isn't aligning itself to center? obj-c

edit solution was to add them to a vertical stack view, thanks to the user below who provided that solution ! So I'm pretty new and managed to create a UIStackView, but it isn't centering in my view ...
user286152's user avatar
0 votes
1 answer
757 views

How to programmatically animate the alignment property of an UIStackView in ios 9

I want to know how can I animate a change in the alignment property of an horizontal UIStackView say from UIStackViewAlignmentCenter to UIStackViewAlignmentTop and vice versa, and I want to visually ...
Airel's user avatar
  • 23
0 votes
1 answer
187 views

UITableViewCell with two UIStackViews

I'm facing a layout issue with a UITableViewCell which consists (from top to bottom) of (1)a UIStackView, (2)a UIView with a fixed height and (3)another UIStackView. In the top UIStackView I want to ...
Raoul's user avatar
  • 111
0 votes
0 answers
573 views

UIStackView removeFromSuperView layout changes

I have a horizontal stack view and I have three UIViews in it. Each time on viewDidAppear I want to add center subview and remove the same subview depending on some conditions. In storyboard; I have ...
lifemoveson's user avatar
  • 1,691
0 votes
1 answer
627 views

programmatically change the aligment of a UIStackView does not work properly

What I have: This is my hierarchy of views: a button named b1 which has an action named "changeAlignment" that is activated Upon touch Up Inside. an UIView named Pview with frame (0,100,414,100)....
Airel's user avatar
  • 23
0 votes
2 answers
466 views

Change tableview cell height dynamically ios [duplicate]

Hi in my application i have a requirement to display prodcuts with description in tablview. For achieving this i added two satckviews on tablview cell content view. Both stackviews holds labels and ...
Naresh G's user avatar
  • 117
2 votes
1 answer
2k views

UIStackView not centering arrangedview

I am implementing a UIStackView and populating a UIStackView dynamically. But when there is a single view in UIStackView, the view is not centred in the UIStackView. I use horizontal axis, center ...
AfterCoder's user avatar
0 votes
1 answer
40 views

Two UILabels like UITableViewCellRightDetail using UIStackView

I have a Horizontal UIStackView with two UILabels. I need it to be styled like UITableViewCellRightDetail. The first Label (on the left) should have more priority in resizing. Here is the example: ...
Burhanuddin Sunelwala's user avatar
9 votes
2 answers
10k views

How can I delete stack view from storyboard

I'm trying to make my UI design by stack view. Unfortunately, I'm unable, so now I want to delete stackview from my storyboard. I have no idea how to delete it and go restore my previous design ...
user avatar
2 votes
3 answers
640 views

Tokens with close button

I'm trying to think of the best approach to get an interface like this: They are similar to the Stack Overflow tokens that you enter when asking a question, except I don't need to be able to type the ...
cannyboy's user avatar
  • 24.4k
0 votes
1 answer
82 views

Nested UIStackViews do not align. How do I align them?

I want to create a spreadsheet style table with stackviews. However as you can see in the image, columns are not aligned due to previous items being wider. How do ı make sure they are aligned ? This ...
The Cook's user avatar
  • 1,433
1 vote
0 answers
182 views

How to Keep Label Height Constant while Embedding it in StackView

I have a UILabel and a UIButton that I need to put in a vertical UIStackView. The design of the screen is such that I need to give some background colour to the UILabel and it needs to have some fixed ...
Kavita Kanwar's user avatar
0 votes
1 answer
66 views

UIStackView behaving unpredictably when inside a Container View

The Stack View H has two UIViews in it and is constrained to fill the parent UIView. The Grey and Green UIViews within the UIStackView are constrained by width so what I am seeing in Interface Builder ...
arcady bob's user avatar
  • 1,574
1 vote
1 answer
1k views

Unexpected rounded UIButton behavior inside UIStackView

I made a cool custom number pad for user input. It consists of 12 UIButtons 3 each inside 4 UIStackViews, which are themselves nested inside a parent UIStackView. I want the buttons to be round. ...
rattletrap99's user avatar
  • 1,479
0 votes
1 answer
771 views

PNChart and UIStackview Issues using storyboard

I'm having difficulty using the PNChart (https://github.com/kevinzhow/PNChart) library with storyboards and uistackviews. I'm expecting the chart to simply fill the space of an existing uiview which I'...
user1542125's user avatar
0 votes
1 answer
871 views

Proportional resizing of buttons in UIStackView

I need to layout 5 buttons as in this image: I need them to resize proportionally on different devices. I have this code in a method which sets up a view with 5 buttons. UIStackView *stackView = ...
dan10's user avatar
  • 119
0 votes
1 answer
164 views

Objective-C append image thumbnails onto the end of a view

I'm trying to append images onto a view and have them display a thumbnail in a nice neat row. The issue I'm having is that it appears all images simply get added on top on each other in the corner as ...
jampez77's user avatar
  • 5,201
1 vote
5 answers
734 views

Automatically adding UI elements to the UIStackView while UITable Scrolling

In my app have an UITable.In the table cell i have added UIStackView to populate while loading the table cell. It was working fine till scroll down the table, The stack view get added more elements ...
gamal's user avatar
  • 1,655
1 vote
1 answer
118 views

UIStackView race condition?

I have a nested UIStackView which when I press a button it's instantiated. To go into more detail I have a UIStackView that iterates through a NSMutableArrayList full of CustomUIStackViews and adds ...
sp00ky's user avatar
  • 161
0 votes
1 answer
322 views

iOS UIStackView individually changing the spacing of UIViews

Looking through the documentation for UIStackView's I found that changing the UIStackView's 'spacing' property to 30 would simultaneously change the distance between all of it's arranged subviews. ...
sp00ky's user avatar
  • 161