How to create shadow effect of UIScrollView, UITableView when scrolling? - iphone

I have a UITableView and I would like it ho have the same effect when scrolling as the picture. (Shadow below UINavigationBar and above of UITableView)
How can I do this?:

You can create a view on the top of the uitable with a custom background.
See this related question: Light gray background in "bounce area" of a UITableView
In your case you could have an image instead of a solid color.

Related

How to scroll a UIView to a certain height and after reaching that point scrolling inside the UIView?

Hey guys I'm new to swift programming. I've been stuck with this problem for a long time. So I have a UIView that starts in the middle of the ViewController, inside the UIView (green) is another UIView (yellow) with dynamic labels in it, so the height can change. You should be able to scroll the UIView(green) up until the NavigationBar and then you can scroll "in" the green UIView to see the rest of the content in the yellow UIView.
How can I achieve that you can scroll to a certain height and then change to scrolling inside the green UIView? Rough Construction of the UIViewController
I have a scrollView for the green UIView, and I set it under the NavigationBar, but it doesn't stop there, you can pull it over that point. Then I tried to set another UIScrollView inside the green UIView to scroll through the yellow content but I don't know how to constrain it because it's dynamic.
I'm thankful for every tip you guys have.

How do I implement a UITableView that can scroll over a background

I'm trying to implement a tableview where the tableview cells can scroll over a background similar to the way the facebook Poke app works. Are they using a custom uitableview or implementing the interface with a uicollectionview?
Create an UIImageView with your background image. Then set the table view's backgroundView property to the image view. This approach works well with a plain style table.
You can give the table view and the cells a clear background color (in IB or code), and give the window a background color -- you can use colorWithPatternImage:, if you want an image in the background.

iOS - Display UINavigationBar drop shadow behind UITableViewCell

I have followed the answer provided here to create a drop shadow for my UINavigationBar. However, the shadow is above the UITableCell that is directly below the bar (image). How would I go about making the cell cover up the shadow, so that the shadow of the bar is only visible if you scroll up?
The simplest thing you can do is to create a background image using Photoshop (or a similar application) leaving 44px (88px for the retina display) from the top and making the shadow start from there.
Then just use that as a backgroundColor of your window.
The NavBar in the image will be covered from the actual navigationBar and only the shadow will be visible (beneath the tableView as you asked.)
I dont know why you want to make the shadow only visible if scrolling up, but may be you can set UIScrollViewDelegate to the table view and deal with the event when the table view scrolling up and set shadow of navigation bar, remove shadow when scrolled to top.

Changing background color of a section in UITableView

Is it possible to set the background color of a section of a UITableView.
I want to set the background color of one section to "UIColor clearColor".
When I did, its showing the transparent section with border. How can I prevent the border.
You need to set separatorStyle property of your UITableView to UITableViewCellSeparatorStyleNone and draw borders inside your cells. Add and position 1px UIView and hide it when you don't need the border to be shown.

unused cells background color

I have a UITableView which displays about 5 cells at a time, yet in my table there might be cases where there are only 2 cells with content as seen on this picture:
alt text http://www.freeimagehosting.net/uploads/30d3602979.png
The white cells below do not look nice, how can I change the background color of these cells to black too? UITableView does not have a backgroundColor property.
Thanks!
A UITableView inherits from UIView, and UIView always has a backgroundColor.
You can also change the background color to "non-opaque", and then change the background color of your parent container.
tableView.backgroundColor = // some UIColor