I want my app's setting UI feel consistent with iphone's internal setting UI. It looks like it's implemented by a table view with sections to group the setting items together. Am I correct?
refer to: http://i.stack.imgur.com/XNVyO.png
Is it implemented by a table view with hard coded cells and sections or is it build by interface builder? If it is built by IB, how to design the sections?
thanks
-Leo
you might want to look at something like InAppSettingsKit, an open source framework that duplicates the settings app feel in your application.
if you want to create it yourself you'd just set the ui table view style to UITableViewStyleGrouped
Read up about how UITableView Work, You will need a UITableViewDataSource.
The datasource tells the table how many sections and cells there are in the table view.
Then the UITableViewDelegate will handle any selecte rows:
http://developer.apple.com/library/mac/#documentation/cocoa/Conceptual/TableView/TableView.html
Related
I am building an app that requires a tableview control so that users can select multiple rows and act upon them in some way. I find it easy to load my data and display it using the UITableViewController but it seems when I do it this way I am unable to place any other controls on the page, such as a toolbar to give the user some actions to perform on the selected rows. I can place a toolbar control on the form in the storyboard, but it doesn't render in the emulator.
Using a UIViewController and placing a TableView on it seems to come with its own set of confusing challenges (that will make total sense once I conquer them).
Is there any advice for a smooth way of getting a table view with toolbar controls? Thanks!
don't use a TableViewController. Use a Standard ViewController, then add a UITableView to it, and adjust the size. This way you will be able to do whatever else you want on that view without limiting yourself to the tableView only functionality.
When you do this make sure you add the datasource and delegate to the connected table. Then add cellForRowAtIndex, number of sections, number of rows, and whatever other delegate methods you need for your table.
Good luck
Is there any advice for a smooth way of getting a table view with toolbar controls?
Yes there are few ways to accomplish this, one way would be adding a footerview to your tableviewcontroller check these
http://developer.apple.com/
UIButtons on tableFooterView not responding to events
Easier way to add this is using storyboard.
Just drag and drop a view in to your tableviewcontroller, then you can adjust the views size and put anything from objects menu to inside of the view.
Now the problem with that is view will not be stable position at the bottom of the page like a tabbar. Lets say you have only 1 row in your tableview, footer view will go up just below that 1 row, lets say you have hundreds of items in your tableview toolbar will be at the bottom of the rows.
The other solutions for your problem would be either create a custom view and adding it to current view or window (this is little bit adbance),but if you want this just google it.
Or just as you said, create a viewcontroller and put a uitableview inside. Dont forget to add <UITableViewDelegate,UITableViewDataSource> to your .h file and then you can call UItableview delegate methods.\
Good Luck.
Perhaps I'm searching for the wrong keywords, but I'm surprised there wasn't already a similar question. If there is, please let me know and I'll delete this question.
What's the best way to customize all table views in an app targeted for iOS 5 or later?
UIAppearance has proved to be very useful for customizing all navigation bars, tab bars, and the like throughout an app. Is there a similar way to customize table view and table view cells?
So far I've been programmatically configuring each table view separately. This might not be the best idea as I plan to have different themes the user can select. I've been thinking about creating a separate class that returns the appropriate image for the table view (or cell) based on the theme the user has selected. Would this be a suitable approach (if there's nowhere to easily customize all the table views)?
The most used way to customise table views is through defining table cells in the nib files:
http://www.galloway.me.uk/tutorials/custom-uitableviewcell/
or storyboards:
custom uitableviewcells in storyboard
I haven't do any tweaks by appearance class yet, but it may be helpful. If you want to to this programatically, use the decorator pattern to ease your and further user's life in joining produced code into the project:
http://sourcemaking.com/design_patterns/decorator
I hope this is helpful
At the moment, I have a settings view in my iPhone app built with Interface builder, it consists of a background image, some text fields, labels and buttons. Because this looks bad, I want to convert the settings view to an UITableView with custom UITableViewCells.
I already tried adding some cells into my settings view's XIB and returning them in the cellForRowAtIndexPath method (with [return myCell];), as written in Apple's tutorial, but this was not working for me - my whole TableView looked strange and it only showed the first cell correctly.
Is it possible to design these custom cells in Interface Builder? Do I have to create an empty XIB for them or can I put them in my view's XIB? And how do I insert them into my TableView?
Thanks in advance,
Yassin
You can absolutely add custom table cells that you built in interface builder. This includes both static cells and Dynamic cells. However without you providing more information the best I can say is "double check the docs and try again." I can only say that it works and it's rather straightforward so it's hard to say what you may have missed. It might be more helpful if you post what you have for the tableView:cellForRowAtIndexPath method.
Since you say you just have some text fields, I would recommend looking at the technique for static row content section of the Table View Programming guide. You probably would want to have each field of your form correspond to a row in a Segmented Table View, it'll make everything look nicer.
I've an application in which each row contains an uiimageview and an uibutton. I have created them using custom cells, uitableviewcells. The button is to trigger the method, uiimagepickercontroller to pick an image from the library and show it in the imageview. I need that any user who uses the application can rearrange the rows as they wish so that they decide the order of the photos. code here
Reordering of rows in a tableview is pretty straightforward, you just need to implement a few methods of the UITableViewDataSource Protocol and your good to go. Have a look at the Table View Programming Guide for info & code.
http://developer.apple.com/iphone/library/documentation/UserExperience/Conceptual/TableView_iPhone/ManageReorderRow/ManageReorderRow.html
You could show an Edit button in the navigation bar if your using a navigation controller, which switches the table view to edit mode, causing the reordering control to be shown. This edit button could be changed to done, once the table is in edit mode of course. Don't forget to set the showsReorderControl property of the cell to YES. From then on, it's just a matter of implementing the right methods.
It seems that you must use the TTThumbsViewController to accomplish this. However, in the example code, TTThumbsViewController is only ever used to manage a scrollview of thumbs. How do you configure it to display cells instead?
_________Original Question_________
Has anyone used the Three20 source and made a tableview (not Fields)?
I am trying to figure out how to insert the TTThumbTableViewCell in a table and it none of the examples even address the tableviewcell classes (just the tablefields).
If you know how to setup a table to use these cell classes, can you post how you accomplished it?
Thanks
I haven't really used Three20 myself, but took a quick look on the source code.
It seems that Three20 have abstracted a creation of table view cells in generic TTTableViewDataSource. It queries class of a table view cell to be created via tableView:cellClassForObject:. TTThumbsDataSource in TTThumbsViewController.m then overrides that to return TTThumbTableViewCell class for TTPhoto objects.
So, if you are not using TTThumbsViewController, you should use TTThumbsDataSource as a dataSource for your table view or create your own similar class.
I was mistaken in how Three20 was setup.
A TTThumbsViewController is a Table view of TTThumbTableViewCells already. You just can't see the lines between the cells.
You can change the way the cells behave by subclassing TTThumbTableViewCells.