How can I get the pinstripe background to show? - iphone

I'd like to use the pinstripe background that shows up in the Settings app and many other iPhone apps behind table views. Is is already included in some graphics library? How can I make it show up in a UIView or UITableView?
Pinstripe http://img.skitch.com/20090630-p783xugab8i9c7x2c63t3ped52.jpg

myView.backgroundColor = [UIColor groupTableViewBackgroundColor];
Just to stick with convention though, don't apply this background unless you're using tableviews that scroll as this type of background is semiotical to tableview scrolls.

You just have to use the "grouped" style on your table view.

As of iOS 6.0, this doesn't work anymore.

Related

How to change UITableView's appearance?

What different kinds of things can you do to edit a tableview's appearance and how would you do them? For example, how would you change the color programmatically? Or change the navigation bar's color programmatically?
Check out the docs for UITableView and UITableViewCell.
You probaby want to change the backgroundColor property or customize each cells contentView property. Also,look into layers, you can do things like make rounded corners, shadows, etc on a views layer.
Here is the QuartzCore Framework docs. They should be useful if your trying to change the appearance of a view.
Edit (good suggestion bshirley):
AboutTableViewsiPhone
Check out Apple's doc on UITableView particularly the configuring A Table View section.
[tableView setBackgroundColor:[UIColor grayColor]];
or You can use,
[tableView setBackgroundColor:[colorWithRed:.98 green:.98 blue:.82 alpha:1]];
If you want to change the appearance of all TableViews in your app you can define it with the Appearance property. In Monotouch you do something like this:
UITableView.Appearance.BackgroundColor = UIColor.Black;
UITableViewCell.Appearance.BackgroundColor = UIColor.Black;
In objective C it would be something similar.

How to design rounded boxes and separators (like the App Settings view)?

I am wondering what is the good way to design interfaces such as the one in the Settings view on an application, for instance :
What I want to do is the nice round rectangle to separate categories and horizontal line separators between categories, I can have a label, text field, slider or any other control in each line...
Do we need to use an image in the background, that seems quite dirty to me, and I cant find any control in IB that seem to do the same kind of layout.
So, how is this done?
Thanks!
Use a UITableView and set it's style to UITableViewStyleGrouped. Remember that the standard UITableViewCell's will just let you show some text and you may need to create custom UITableViewCell's to achieve more (for example, a on-off switch).
If you wan't to customise it you can add a background image. To do this, place a UIImageView behind the UITableView and make sure you set the UITableView background colour to clear:
theTableView.backgroundColor = [UIColor clearColor];
To seperate the categories make use of the "sections".
Basically, you can use grouped table.You can have sections with different/same number of rows.

Customise top bar of an iPhone application

Is it possible to customise the top bar of an iPhone application (not a website)? If so, how can I change the background colour to orange?
If you are talking about the very top bar (with the wifi-strength etc) then it's impossible following the AppStore-rules. You can change it to black only.
It's however possible with various jailbreak-tools, but then you can't publish your app to app store.
So, I'm guessing here you could be talking about a UINavigationBar or a UIToolBar, but that doesn't really matter because yes, you can change the colour of either.
In Interface Builder, select the UINavigationBar (or UIToolBar) and under properties look at "tint". This will be set to "default" initially. You can then pick any colour (even orange!) as the tint colour, and there you go!
You can do so by using the tintColor property of the navigation bar.
I have implemented and checked it. its working.
self.navigationController.navigationBar.tintColor=[UIColor orangeColor];
hAPPY cODING...

Set UiView background image like apple default style

I'm new on Cocoa OBJC and iPhone dev.
Where to find the default background that apple uses everywhere (like the one on the iphone's default setting app) ?
It's possible to set the image from interface builder or you have to set by line code?
Thanks
To expand on Carl's answer: if you create a UITableView in the grouped style, either via Interface Builder or using the -initWithFrame:style: method with UITableViewStyleGrouped, you'll get that background by default. Before iOS 6, if you wanted to apply it to another view, you could set that view's backgroundColor to [UIColor groupTableViewBackgroundColor]; since then, that method has been deprecated and you need to create the color yourself.
That's just the default background of a UITableView. If you make a UITableView, you'll get the background.

iPhone UIImage overlapping text

I have a view with a UIScrollView, UIImageView for a background, and a UITextView. I have created several other views just like this and they all come out okay - with a background image and scrollable text but for some reason, now I can't make that work. Either my image overlaps all of the text so that I can't read it or the UITextView default background (white) shows up so that the user can't see the background image. What could be causing this problem?
Do you use Interface Builder or build the views hierarchy in code?
In both cases you should make sure that the order of your views is correct.
In IB the view that you want to appear on top of all the rest has to be under the rest of the views.
In code, make sure that the text view is the last to be added to the hierarchy.
You could also use the next code in order to check if this is the problem:
[self.view bringSubviewToFront:textView];
Okay, it must have had something to do with choosing the delegate. I can't say that I completely understand how I fixed it but it had to do with declaring the delegate in IB.