How to put background for UITableViewController - objective-c

I wanna do something like THIS in my ipad application, what is the best way to do the followings:
The shadow under the upper bar.
The padding for the papers (top, left, right & bottom)
The background (as a notepad) : please think about the cells: they must still scrolled inside the paper and cropped before reaching to the paper bottom edge.
I'm looking for the optimal solution that avoids overriding as much as possible.
EDIT :
I tried to use UIViewController (with UITableVIew and has the delegate methods) inside UISplitViewController, And I tried adding UIImageView at the top of the table but this view will scroll with the cells and it'll hide when I scroll down. I tried to use viewForHeaderInSection function also for upper shadow (under the bar) but what about the papers bottom edge (what if I put one image including the shadow and the papers bottom edge and has the padding as a background for the UITableView or UITableViewController, and change this image when rotate to the portrait orientation? is this a good and possible solution?)

My guess:
Create the background in an image editing app
Cut 4 images, for header, footer, left and right sides
Create a UIViewController with 4 UIVIews and add the correct images as background
In the middle of all 4 add a UITableView
This way the images won't move and if you position the UIViews with the background properly, your TableView will scroll inside the notebook (assuming you are trying to create a notebook)
If you app is iOS 6.0 only, autolayout will be a great help. Check apple developer video on it to learn how to use this feature: WWDC 2012 Session 232 - Auto Layout by Example

One easy way to do this is from the xib:
1. In xib create image .On image view you can put background whatever you want as a image.
2. create table view above the image view and set table view background color as a clear color.
This will do it.

Related

uibutton on top of image view not aligning

I have a UIViewController which contains a UIImageView, and I put a UIButton on top of the UIImageView.
I am using size classes (width compact, high regular, all iphones portrait).
When I add constraints to the button, it changes positions on different iPhone screens.
I have checked a lot of size class tutorials, but all of them are like putting button in the centre, or adding multiple buttons then evenly spread out.
Do anyone know any tutorial like adding only one button to the screen, and the button remains at the same position according to the background image?
Settings:
settings
Storyboard at design time
TBC
Remove Use Size Classes and Use AutoLayout and then change the view gaps from the column next to attributes inspector
This way you can have constraints and same location on all devices

Create iOS 7 UIButton With Text And Image Using Autolayout

Using Autolayout and Interface Builder with the target device being iOS 7 iPhones, how do I create three of these kind of UIButtons that have an image, a divider line and text? The 3 images for each of the buttons all have the same size. The lines and text in one button must line up with the other buttons' line and text (left align the text). Things can't go crazy if the phone is turned to landscape. All buttons are the same constant size.
The buttons are part of a home screen layout which has a logo at the top and so on. When one taps one of the buttons, the app does something.
One thought was to create a button with no text, put a label on top, a thin view for the line on top, and the uiimageview on top. Maybe explicit layout constraints are not even needed? Maybe a containing view is needed for the "button" contents to keep the "button" pieces together?
Image+text can be achieved using UIButton only without adding any autolayout constraints. You set both image and text using -setImage:forState and -setTitle:forState:, and then adjust button insets using *Insets properties. To set the insets properly, play with this great test project: https://github.com/jrturton/ButtonInsets (it's not quite clear from the docs how to use them simultaneously, and this test app should give you the idea).
As for the separator, I'd recommend adding it directly to your images.
But if you don't want to stick to the UIButton and its insets, you can subclass UIView, add 2 UIImageViews (the actual image and the separator), a UILabel, and throw in a couple of constraints. To make the view clickable, you attach a UITapGestureRecognizer to it.

UITable View is filling the entire view

I am working on an iphone application on XCode 4.3 using storyboard.
I have created a view and I need it to be divided in two parts. the top part will contain a UIImageView and the bottom part a UItableView.
So I added both to the view using the storyboard interface builder, and set the sizes and positions of the UIImageView and the UITableView.
However when I run the application, the UITableView will take the entire view (it is being scaled to fill the view). I need it just to stay at the width/height I specified in the IB.
Why does the UITableView take the entire view? and how can I make a view with a UITableView be a small part of the view and not fill it?
I hope I was clear
Thanks a lot for any help
edit:
Screenshot of the storyboard section
the top part has a UIImageView and a "Share" Button
and the bottom part a UITableView
The UITableView is taking the entire view and hidding the rest
Another screenshot requested
I am not using storyboard here, just a xib, but it should matter. This is how you should set it up:
Autoresizing for UITableView:
Autoresizing for UIImageView:
Notice the fixed top margin for image view, fixed bottom margin for tableview, and flexible height for both. This will ensure tableview always sticks to the bottom and expands upwards proportionally, and vice versa for image view.
You would want to play around with this settings of your UITableView
I believe the setting is off making it resize. But I might be wrong.
Note: this is a screenshot of my UITableView inside a view controller and it is NOT filling my screen. It may have a different setting in your case. So play around with the values in there.

How can I add shiny surface to UITableView

How can I add shiny surface to UITableView
This is done easily. From the screenshot you supplied it appears that most of what you're pointing out is photoshopped images positioned with UI elements supplied from within Xcode and customized via code.
The tableView for example appears to be on a Grouped Table View laying on top of a photoshopped textured image. The tableView itself has a custom color to all the cells and a custom color and shadow to the cell separators. You can use Google to see how to customize a UITableView pretty easily.
But like said, most of this is from the magic of Photoshop.
Create your own views and photoshop them.

UISegmentedControl custom background image

I have UINavigationBar setup as image - some wood texture. I want to insert UISegmentedControl with 4 buttons on that bar. Buttons should have same texture with slightly changed tint.
One solution would be to change tint alpha of buttons background color, so that texture in background can get trough, but as I set alpha for tint in IB it doesn't save value, it always gets back to value 1.
I cant get UISegmentedControl to show background image, so finally gave up and decide to search for help...
Effect that is desired is one in iBooks app, with buttons in Navigation Bar.
Any link or small help would be appreciated..
This post describes the steps involved and has sample code: http://idevrecipes.com/2010/12/13/wooduinavigation/
https://github.com/xhan/PlutoLand/blob/master/PlutoLand/UI/PLSegmentView.h
a custom SegmentView that can specify two images(normal, clicked)
Do not bother with one of those custom segmented control packages if you're on iOS 5 or later.
Per Dylan's suggestion, use the Appearance functionality in iOS 5+.
See the top answer here:
Customizing Left & Right UISegmentedControl Buttons