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 alignment and fill equality distribution in UIStackView. How can I start to populate UIStackView by putting views in center of the UIStackView?
Current behaviour of UIStackView
I want to start adding stars in the center of the UIStackView

I am new to UIStackView sorry for an easy question.
I'm adding arranged views like;
tmpView = [[UIView alloc] init];
tmpImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"iconStar"]];
[tmpView addSubview:tmpImageView];
[self.horizontalStackView addArrangedSubview:tmpView];
How can I achieve desired behaviour?

                        
OK, it is as I thought. When you set the
alignmentof aUIStackViewthis works perpendicular to theaxisof the stack view.So in your case, the
centermeans it will center the items from top-to-bottom (which it is doing).In the direction of the
axisthe stack view will fill up from the top (in averticalaxis) or from the left (in ahorizontalaxis).If you want your image to be centered like in your second screen shot then you could change the
axisto.verticaland it would work. Without knowing what your end goal is I can't really recommend a specific solution.If all you want is to align the single image this way then this should be fine.