views:

33

answers:

2

Hello all, I need some help with GUI Iphone development I am currently develop iphone application and finish with the logic side of the app. now i am trying to handle the GUI side but i cant understand few things.

i need to represent list of shops that each shop will display on row and for each row i need button that can be ON or OFF (very similar to the setting -> Airplane Mode that have ON OFF button). example:

ZARA ON OFF
POLO ON OFF

I also want to represent list of shops with star sign on each row(like favorite star) example:

*(favorit star) ZARA
*(favorit star) POLO

there is any way to do so in interface builder? if some one can give me code exaple it will be great

A: 

UISlider.

I don't know of built-in stars, but you can use a toggleable UIButton and your own star graphics.

tc.
+1  A: 

For custom controls in UITableViewCells you can take a few different paths:

  1. Create a UITableViewCell subclass in Interface Builder and return that cell in the cellForRowAtIndexPath.
  2. Use the standard UITableViewCell accessoryView and add a UISwitch as a subview.

If you want a more customized cell (multiple controls, e.g. a switch and a star) I would prefer using Interface Builder because I can lay out the controls visually.

Rengers
yes but my list is dinamic and i want switch button for every rowand in interface builder i can put switch button for the rows that i see when i build it but in run time the switches are displayed only on the rows i put them in the interface builder
Amir
Don't put the controls in the UITableView. Create a UITableViewCell subclass and lay out the controls in interface builder. Then in the table view data source, load the nib. Maybe this will help you: http://adeem.me/blog/2009/05/30/iphone-sdk-tutorial-part-6-creating-custom-uitableviewcell-using-interface-builder-uitableview/
Rengers