title: Create a Horizontal Stackview with 2 UiView Inside
body: <p><strong>What I Want:</strong></p>
  
  <p>I want to place 2 <code>Views</code> side by side in a horizontal way. For this I am creating <code>UIStackView</code> programmatically. Look at the below snippet </p>
  
  <p><strong>What I Have Done:</strong> </p>
  
  <pre><code>let mStackView = UIStackView()
  mStackView.axis  = UILayoutConstraintAxis.horizontal
  mStackView.distribution  = UIStackViewDistribution.fillEqually
  mStackView.alignment = UIStackViewAlignment.center
  mStackView.spacing = 10
  </code></pre>
  
  <p>Now inside this I want to put 2 <code>UIView</code>. Each <code>UIView</code> will keep center aligned <code>UIImage</code> and <code>UILabel</code>. For this I am using another <code>UIStackView</code> in each <code>UIView</code> </p>
  
  <p>have a look at this snippet. </p>
  
  <pre><code>let mDonationView = UIView()
  mDonationView.backgroundColor = UIColor.green
  
  let SV = UIStackView()
  SV.axis  = UILayoutConstraintAxis.vertical
  SV.distribution  = UIStackViewDistribution.fill
  SV.alignment = UIStackViewAlignment.leading
  SV.spacing = 1
  SV.alignment = .top
  
  let imageName = "Donate"
  let image = UIImage(named: imageName)
  let imageView = UIImageView(image: image!)
  imageView.frame = CGRect(x: 0, y: 0, width: 100, height: 200)
  
  let lbl = UILabel(frame: CGRect(x: 0, y: 0, width: 150, height: 21))
  lbl.text = "Donate"
  lbl.textColor = UIColor(hex:AppColor.colorTextPrimary)
  lbl.font = lbl.font.withSize(14)
  
  SV.addArrangedSubview(imageView)
  SV.addArrangedSubview(lbl)
  SV.translatesAutoresizingMaskIntoConstraints = false
  
  mDonationView.addSubview(SV)
  </code></pre>
  
  <p>and in the end I am adding this back to main <code>UIStackView</code> namely <code>mStackView</code> in first code snippet. See below: </p>
  
  <pre><code>mStackView.addArrangedSubview(mDonationView)
  </code></pre>
  
  <p>similarly I am creating another view and adding in above shown way. </p>
  
  <p><strong>Problem:</strong> </p>
  
  <ol>
  <li>My problem is I can see 2 views side by side, but in that the <code>UIImageView</code> and <code>UILabel</code> are aligned on left where I wanted to be center horizontally and Vertically inside <code>UIView</code>.</li>
  <li>Both <code>UIView</code> must be equal in <code>width</code> </li>
  <li><code>UIView</code> are not taking <code>colors</code> which I have given green to each <code>UIView</code></li>
  </ol>