Мне нужно создать пару UIButtons с различной шириной программно в моем приложении (iOS 6.0 и выше).
Я хочу отображать кнопки в стиле "обертывания": начиная с левого края каждая кнопка должна располагаться рядом друг с другом по горизонтали (в определенном порядке), и если кнопка не подходит в текущем "line", он должен начать новую строку на левом краю ниже предыдущей строки.
Примечание. Мне не нужна таблица/сетка, так как кнопки имеют разную ширину, и я хочу иметь один рядом друг с другом.
Я мог бы вручную вычислить кадр каждой кнопки в моем коде, но должен ли я использовать AutoLayout (с программно созданным NSLayoutConstraints)? Как именно мне нужно его настроить?
EDIT: после прочтения главы 4 "Промежуточная автоматическая компоновка" "iOS 6 от Tutorials" Я не уверен, что использование чистого AutoLayout могло бы реализуйте эту функцию "обертывания", которую я требую.