PaperThick
PaperThick

Reputation: 2799

Button group in IOS

I would like to create a button group in style with this in IOS.enter image description here

I have tried with a static uitableview but that did not work due to static cells has to be embedded directly within a tableviewcontroller and I want some text and other stuff in this view as well.

And if it is possible I would like to do this from the storyboard mostly. But if its not possible I can do it programmatically.

Thanks in advance for any suggestions

Upvotes: 1

Views: 2375

Answers (1)

Joel H.
Joel H.

Reputation: 2784

The best way to do this is with a UITableView with the style UITableViewStyleGrouped. See this question: Here.

Since you want more dynamic behavior, I'd recommend placing the UITableView in the storyboard, then making an outlet to your UIViewController subclass code. Make your UIViewController both a <UITableViewDelegate> and a <UITableViewDataSource>, and set the contents and behavior of your "buttons"(actually cells) programatically.

Upvotes: 2

Related Questions