Could anybody hazard a guess as to how exactly the explanatory text was added to the blank state Today screen in the Things to-do list iPhone app? Is it a background image or a view that somehow sits in front of the UITableView?
Thanks in advance.
John, everytime your method numberOfRowsInSection: is called (considering you are using only one section), or everytime you call reloadData to your UITableView, you can do the following (considering that numberOfRows is the total number of rows in your UITableView and that explanationView is the UIView (that you can configure via code or interface builder) you want to show:
[explanationView setHidden:(numberOfRows>0)];
This looks like a view, maybe a UILabel added and hidden and only unhidden when the number of items to be displayed in the list are 0.
Related
I have a class as "myUIImage" extended from UIScrollView. it has a UIImageView variable.
ViewController delegates "UITableViewDataSource , UITableViewDelegate".
when I add a myUIImage object into all cells in cellforRowAtIndexPath function,(With a cellview that fills whole cell(frame size are same)), the problem occurs.
When i touch one of the rows didSelectRowAtIndexpath returns wrong row index on iOS7. it works well older versions.
I put the example xCode Project here ;
https://www.dropbox.com/s/ps7cc8l51v0grxb/repeatboxDeneme.zip
Thanks For Your Help...
Edit1:
Here is a sample video. Please watch carefully the Logs on down-right side.
http://www.youtube.com/watch?v=5f8-nrlWCIY&feature=youtu.be
This is working perfect on both iOS 6 and iOS7 because i've seen your code. And your code is also perfect. But there is a problem that is you are not using reusable cell. So might be it create problem releated to memory and its not a good practice.
This is no normal behaviour of UITableView. But it looks to me like it just happens if you clicked while scrolling and if it stops it remembers your last click position.
I would recommend you, to insert an UITableView into to your view inside the Storyboard. Connect the Delegate and Datasource of your UITableView with the Filesowner and than just use the methods
numberOfSectionsInTableView
numberOfRowsInSection
cellForRowAtIndexPath
didSelectRowAtIndexPath
Maybe the way you generate your tableview programmatically, there are any attributes missing. The other way you just can look at the InterfaceBuilder settings on the right and can change the settings much easier.
The table view shows properly at the start, but when I do a reload due to someone typing text in a searchbox, the table does not show the cells. This worked perfectly in iOS 7
This is what I see, everything is called correctly, cellForRowAtIndexPath is called and worked (checked with NSLog), but no view is displayed.
There is definitely data, that is not the problem. Has something changed with UITableView?
The problem is probably in the way you reuse/allocate your cells in cellForRowAtIndexPath method in case it is not the background colour ?
I had recently changed the UIScrollView to a UITableView, and added in some code to remove all the subviews from the UITableView. This kept the headers as shown in the picture, but not the labels and pictures on the cells.
I'm working on iOS RSS app, and my last view, which is a UIViewController, is similar to the attached image. I inserted in my DetailView.xib, one Image View to pass the images of the RSS feeds and two Text View to pass the title and summary respectively.
The question is, how can i make the same, but inside a UITableview?
you can use custom cells for it and can add this custom cell at particular index. At first index you just add image view and at second index you just add textview.
Check out this pretty good tutorial Custom UITableViewCell Using Interface Builder.
i hope it helps you.
You can achieve this particular thing by using Custom Table View Cell.
Table View gets created using single Table View Cell again and again. It is much more efficient and uses less memory.
You should check this tutorial.
I hope it will help you.
Thanks
You can make TableView height UITableView.automaticDimension and make sure UITextView autoscroll is disabled and constraint should be leading, trailing, bottom and top.
Here's the link this might work for you:
How to make a UITextView Expand with the text like the Notes app
So, I've laid out a UITableViewController with two prototype cells, and a view in the TableView's header area. In the header area, there are two views that each hold an icon and a label, Friends and Groups.
It looks all good in the Storyboard Editor, but when the screen actually loads, the images and labels in question are gone. I'm fairly new to iOS, so I haven't run into this before. Here are a couple screen shots to illustrate:
In the storyboard editor:
On the simulator:
Any thoughts? Thanks in advance for your help.
You've implemented the data source methods in your view controller, correct?
If not, UITableView will call a method that its data source implements: tableView:cellForRowAtIndexPath: from the UITableViewDataSource protocol, where you would return the cell to use, in this case the cell with the Identifier that you specified in your Storyboard.
We figured out that this was because the tableHeaderView of a UITableView is really weird about updating/redrawing. It's very difficult to get it to act in any sort of expected behavior.
Instead of using UIImageViews, we used UIButtons. The buttons seem to know how and when to updated and redraw themselves, so that worked.
i was wondering how do i do this?
I wish to make a tableview configured in a way that if i scroll down a tableview and click on one row, i will be brought to another view. But when i click a back button of some sort. i return to the tableview but still viewing that particular row. kinda like the iPod table in the iPhone? Remembering scrolled position?
i just want to know how to do the 'remembering scrolled position' part.
Save your index path in tableView:didSelectCellAtIndexPath: before pushing the new view, use it later. This will give you the NSIndexPath pointing at the cell that was selected by the user, not necessarily give you the same position it was at before they tapped the item. So keep that in mind.
Continue from jer's answer. You can use indexPath when calling this method in tableView:
UITableView selectRowAtIndexPath:animated:scrollPosition: