PDA

View Full Version : Table View like iphone STOCK apps




lmktommy
Jul 31, 2011, 05:37 AM
Dear all, I am a newbie programmer of xcode. Currently, I try to create a view like stock apps in iphone which is provided by yahoo. Expert, would you give me some hints using which objects can build a view like the picture as below? Thank you.

http://usera.imagecave.com/lmktommy/IMG_0154.PNG.jpg



ChristianJapan
Jul 31, 2011, 07:11 AM
Class UITableViewCell is the key for you.

You can add other UIViews (like Text fields or images) and construct the content yourself for each cell.

There is the property in UITableViewCell.contentView which you can use to add views.

Try first some table samples from SDK and modify those. There are conventions to follow when programming a table. I tend to not use InterfaceBuilder. Instead I create all objects manually by code. Gives me more flexibility. But you need to find you own way based on your preferences.

lmktommy
Jul 31, 2011, 11:47 AM
Class UITableViewCell is the key for you.

You can add other UIViews (like Text fields or images) and construct the content yourself for each cell.

There is the property in UITableViewCell.contentView which you can use to add views.

Try first some table samples from SDK and modify those. There are conventions to follow when programming a table. I tend to not use InterfaceBuilder. Instead I create all objects manually by code. Gives me more flexibility. But you need to find you own way based on your preferences.

Thank you for your reply and focus on my problem. Right now, I can create a table view with 2 section. But, I cannot fix the the height of first section. That means I cannot create a scroll bar on table in first section. Would you give me more hints on it? Thank you very much.

robbieduncan
Jul 31, 2011, 04:19 PM
It almost certainly not a table view with 2 sections, rather two views: a table view at the top and a view with a UIPageControl in a (footer view along with the i and Y! buttons. The pages are two UITableViews a totally custom view for the graph.

ChristianJapan
Jul 31, 2011, 04:40 PM
It almost certainly not a table view with 2 sections, rather two views: a table view at the top and a view with a UIPageControl in a (footer view along with the i and Y! buttons. The pages are two UITableViews a totally custom view for the graph.

Agree, that are two table views. Which also makes the implementation easier as you would not have to care about two different ViewCells classes in the same table. That would add up some complexity. Maybe needed for other cases.