I am kind off struck in implementation of indexed UITableView. The content display size of tableview in my application is of dimensions 320X250. I am successfully able to display the indexes in tableview as display area is small so half of indexes are displayed by default as "dot symbol".
Any suggestion regarding this would be really helpful.
Cheers!!!
For that,
You have to take UILabel inside the "cellForRowAtIndexPath" method.
And assign the label x, y position and width & height.
So, it will be display properly.
Let me know if you want source code for that.
That is the default behavior of iOS. It automatically truncates the indexes when they are too many to display.
Related
For an iPhone app, I'm going to need to display read-only tabular data in a grid format. This data could potentially have many rows and columns.
I could use UITableView, but the problem is the data will most likely be very wide and require scrolling.
Is there a way to put a UITableView in a UIScrollView and allow zooming and scolling x and y, but still take advantage of reusable UITableView cells? I assume putting a huge UITableView in a UIScrollView would not take advantage of the cell reuse (virtualization).
Or am I better off using UIWebView and a HTML table?
A webView with HTML tables would likely use more memory, but end up being a lot easier to code and debug than 2D cells inside a tableView inside a scrollView.
Another option for a really large table might be a tiled scrollView where you only render the visible tiles (and release and/or reuse the offscreen tiles).
If you're still looking for a native solution, you might consider this iOS data grid - even though it's not free, it's quite full featured.
Is anyone aware of a website or download to reference for the size of UI elements or standard iphone interface stuff? What I mean is something that gives the height of elements like the status bar, tab bar, navigation bar, default tableviewcell height (and such things as width of accessory view, indentation, etc), default icon sizes, default font sizes for UI elements (if they need to be mimicked, for instance), etc etc etc.
It's amazing how many times I have to go back to find a reference or estimate the size and position of a standard element. It seems like it would be an invaluable resource that could fit on a printed page or two.
Found most of what I was looking for here:
http://www.idev101.com/code/User_Interface/sizes.html
This website has a PSD with the iPhone UI elements that might give you the exact information you are looking for.
http://www.teehanlax.com/blog/2009/06/18/iphone-gui-psd-30/
im searching for a solution of the following problem:
i got a "larger" XHTML string that i want to display in an area that is scrollable.
I already used TTStyledTextLabel for a small text-caption and it works pretty well.
But now i want display it more like a UITextView that scrolls or a UIScrollView with my TTStyled Content in it. i think TTStyledTextLabel isnt the right thing to view such a large (with large i mean about 900px height) content.
i need a TTStyledTextView, or something like that. Does something exist? How to work with it. My Content has a variable length so i cannot setup a UIScrollView with a TTStyledTextLabel in it.
Any hints for me ?
Thanks!
You can determine the height needed to display the whole XHTML string by doing this:
htmlLabel.text = [TTStyledText textFromXHTML:htmlText];
[htmlLabel sizeToFit];
CGFloat height=htmlLabel.height;
I do this to create dynamic table cells that include these labels. You can use this height to set the contentSize of a parent scrollview.
You might however run into problems if your view is higher than 1024pixels on iPhone OS 2.x:
Note: Prior to iPhone OS 3.0, UIView instances may have a maximum height and width of 1024 x 1024. In iPhone OS 3.0 and later, views are no longer restricted to this maximum size but are still limited by the amount of memory they consume. Therefore, it is in your best interests to keep view sizes as small as possible. Regardless of which version of iPhone OS is running, you should consider using a CATiledLayer object if you need to create views larger than 1024 x 1024 in size.
In reference to my previous question, I would like to know how to implement a large grid of cells in an iPhone application.
I'm working on an interface which would be similar to an Excel spreadsheet, with many rows and columns. Do I have to handle each cell separately? How can I handle user interaction in each cell?
Is there a standard way to create this type of control?
There is no real standard mechanism.
If all of the cells in a given row will always fit in the width of the screen, one way to do it would be to create a UITableViewCell with several UILabels and vertical separators between them. If all of these rows had "columns" of the same width, you would get the appearance of a grid.
If that isn't possible, it might be helpful to think about what the table view control truly is. A table view is just a scroll view that automatically adds, removes, and recycles its subviews so that only the ones that are visible at a given time are in memory. There is no reason you could not write a GridView control that did the same thing, but in two dimensions. It wouldn't be as easy as using the built-in table view, of course, but if the table view can't do what you need, well, that's why Apple isn't writing all the apps.
Sounds like the exact thing that UICollectionView was made for!
http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UICollectionView_class/Reference/Reference.html
Look at my answer to this question: MS Excel type spreadsheet creation using objective-c for iOS app.
Basically there's no standard way to do this. You will need to made everything by hand and there's 3 ways to go:
Use a UIWebView and layout everything using html/js.
Modify a UICollectionView.
Make everything by hand using Core Data.
I wanted to generate one fix view using interface builder, but the size of that view is exceeding the size of iphone screen,and I am not able to maximize screen. I wanted to show table view in that screen.
I did enabled scrolling but that didn't work,
Update 1:
Actually I wanted to show thumbnail image inside cell and i want to show 5 cell so 5 thumbnail image,those images are static. So which is a better way to achieve this ,interface builder or programming?
Hope this is clear enough.
Your question is not terribly clear, so this is the question that I am attempting to answer here:
You want to have a table view which has five rows, each of which has a small image.
Short answer: you can't do this entirely in the Interface Builder. What you can do is define your table view, including the "look," scrolling abilities, etc. And then in the same XIB file you would define the table cells (which can include your pictures, captions and what have you).
You then have to connect the two together programatically. Apple provide plenty of examples in the SDK on how to do this.