0

Here I have attached my image. In Image there are one green box and blue box. Green box is UITableviewCell or One UITableviewRow. Blue box is part of Green Box

In this box Blue box is dynamic means according to requirement Sometime i do not need blue box or I need blue box multiple time means sometime there are 1, 2, 3 or 4 Blue box (Randomly).

So how I can achieve this logic here I attached my code. in this code I can set blue box only one time and I set AutoLayout of all objects Just I want to know how I can add multiple blue boxes in Green Box (UITableViewCell) and simultaneously height of UITableViewCell need to increase according to content

https://drive.google.com/file/d/0B5mabdphYDhzSXlDZjQ1Y0xvOVk/view

Guide me Thanksenter image description here

Ankur Patel
  • 477
  • 5
  • 19
  • It depends on how you set the Auto-layout for cell, You can refer then below link, in this code is written in swift, but by reading this blog you can understand how to set auto layout for dynamic tableview cell. https://www.raywenderlich.com/129059/self-sizing-table-view-cells – Wolverine Oct 07 '16 at 05:08
  • And also a detail solution for your problem in answered in this question. http://stackoverflow.com/questions/18746929/using-auto-layout-in-uitableview-for-dynamic-cell-layouts-variable-row-heights – Wolverine Oct 07 '16 at 05:09
  • @Wolverine Thanks for response I have successfully expand dynamic height of UITableviewCell and implemented Self-sizing concept. This things is working in my above link code But I want to add multiple(Randomly) blue boxes in Green box and sometimes I do not need blue box in Green Box and because blue box is part of UITableviewCell Green Box How can I add many blue boxes and in green box – Ankur Patel Oct 07 '16 at 05:30
  • You can try Stackview. https://www.raywenderlich.com/114552/uistackview-tutorial-introducing-stack-views It works Horizontally and vertically both. Or you can use the old approach of creating view programatically in tableview-cell. – Wolverine Oct 07 '16 at 05:39

0 Answers0