Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 09-17-2008, 04:57 PM   #1 (permalink)
New Member
 
Join Date: Aug 2008
Posts: 20
Default Title bar on top of view?

I've searched all over for the answer for this. I think the problem is not knowing what to search for.

Basically, how do I keep my views either below the title bar (vertically below) or keep my views on top of (stacking order) the title bar?

Unless I move my view objects down, they all look like this:



Please pardon my noob'ness and thanks for the help.
bmzero is offline   Reply With Quote
Old 09-17-2008, 05:52 PM   #2 (permalink)
New Member
 
Join Date: Apr 2008
Posts: 802
Default

Do you use Interface Builder? If so set the window to have a status bar.
scottiphone is offline   Reply With Quote
Old 09-17-2008, 10:04 PM   #3 (permalink)
New Member
 
Join Date: Aug 2008
Posts: 20
Default

Quote:
Originally Posted by scottiphone View Post
Do you use Interface Builder? If so set the window to have a status bar.
Yes, I use IB. I'm having trouble actually selecting the window. Am I missing something? I can select the view all day long, but I have no idea how to select the window. Any hints?
bmzero is offline   Reply With Quote
Old 09-17-2008, 11:06 PM   #4 (permalink)
New Member
 
Join Date: Apr 2008
Posts: 802
Default

If you've used one of the project templates you should have a Window in your MainWindow.xib. Select it in IB and do a get info. Status Bar can be set for none, black, etc.

Assuming your view is added to the window and is set to autosize then it should conform to the status bar. You can try moving the view down if it's already added to the window in IB.

As a last resort you can move the whole frame down in the awakeFromNib but that's a patch.
scottiphone is offline   Reply With Quote
Old 09-18-2008, 08:51 AM   #5 (permalink)
New Member
 
Join Date: Aug 2008
Posts: 20
Default

I've gone in and selected "gray" for the window's "status bar" under "simulated metrics", and I double checked that the view was set to "scale to fill", but it still appears under the status bar when I run it in the simulator or on the phone.

I can move each of the components down within the view in IB, but that seems like a hack.

In IB, while editing the view, I can set the status bar to "gray" under simulated metrics, but all that does is make everything taller (it doesn't shrink the view vertically accordingly, it just makes the IB window taller), which has no affect on the size of the view.

This seems overly complicated. You would think it would be obvious that a view should not appear under the status bar in an application. Am I still missing something?

How are you guys getting around this?

Thanks for the help.
bmzero is offline   Reply With Quote
Old 09-18-2008, 09:10 AM   #6 (permalink)
New Member
 
Join Date: Aug 2008
Posts: 20
Default

I'm adding the view to the window like so:
Code:
[self.window addSubview:[sendToFriendViewController view]];
bmzero is offline   Reply With Quote
Old 09-18-2008, 09:27 AM   #7 (permalink)
New Member
 
Join Date: Aug 2008
Posts: 20
Default

Here is what I'm working with.



I set the background color of the view to yellow to illustrate my problem.

Running it in the simulator gives this:



Obviously there is some problem with the view remaining static to the top of the iphone versus below the status bar.
bmzero is offline   Reply With Quote
Old 09-18-2008, 09:36 AM   #8 (permalink)
New Member
 
Join Date: Aug 2008
Posts: 20
Default

Here are the window settings:

bmzero is offline   Reply With Quote
Old 09-18-2008, 09:51 AM   #9 (permalink)
New Member
 
Join Date: Aug 2008
Posts: 20
Default

I just noticed something else that might help shed some light on this issue. When I open up my peoplePicker, it has the same problem as the other views; being under the status bar. Seeing that i have no control over the layout of the people picker, it seems this may be an issue with the window or how I'm adding a view to the window.

bmzero is offline   Reply With Quote
Old 09-18-2008, 12:09 PM   #10 (permalink)
New Member
 
Join Date: Sep 2008
Posts: 1,431
Default

Why don't you just build a Navigation Based app from the template and see how it works? That is a project that does exactly what you want and it works.
PhoneyDeveloper is offline   Reply With Quote
Old 09-18-2008, 12:12 PM   #11 (permalink)
New Member
 
Join Date: Aug 2008
Posts: 20
Default

Looking back on it, that would probably have been the way to go, but at this point not knowing why this is happening is bothering me. Maybe it's my OCD kicking in.

Moving to Navigation is the last resort.
bmzero is offline   Reply With Quote
Old 09-19-2008, 07:56 AM   #12 (permalink)
New Member
 
Join Date: Aug 2008
Posts: 20
Default

Any suggestions here? I'm stumped.

I can hack through the view issues, but I can't figure out any way to keep the people picker below (vertically, not stack order) the status bar.
bmzero is offline   Reply With Quote
Old 02-25-2009, 10:14 AM   #13 (permalink)
Registered Member
 
Join Date: Feb 2009
Posts: 4
Default

Hi bmzero,
I have exactly the same issue... Have you found anything new ?
unfalkster is offline   Reply With Quote
Old 02-25-2009, 10:18 AM   #14 (permalink)
New Member
 
Join Date: Aug 2008
Posts: 20
Default

Quote:
Originally Posted by unfalkster View Post
Hi bmzero,
I have exactly the same issue... Have you found anything new ?
Nope. I gave up on it and moved on to something else. Please post back if you find out the solution. Hopefully by now, the right way to to this is public knowledge.
bmzero is offline   Reply With Quote
Old 02-25-2009, 12:28 PM   #15 (permalink)
Registered Member
 
Join Date: Feb 2009
Posts: 4
Default

Ok, I might have found some leads.

I used to have a simple view into a nib file (say TheView.xib), with, as File's owner, a subclass of UIViewController.

But if I add a viewController with IB in the mainWindow.xib nib file, setting the nibname "TheView" in the attribute inspector (cmd+1) and accessing this controller in my code with the IBOutlet keyword system, it's seems to work.

I am conscious that I am not very clear there but in fact all I did was just copying the mechanism in place when you use the Xcode new project assistant "View based application".

For some reason, you have to have your controller (.m file, subclassing UIViewController) represented somehow by an IB viewController (see in attachment).

I am kind of new with the iPhone SDK, so all these things are still difficult to understand, but I hope I helped...
Attached Images
File Type: png Image 1.png (4.4 KB, 62 views)
unfalkster is offline   Reply With Quote
Old 05-13-2009, 07:53 PM   #16 (permalink)
New Member
 
Join Date: May 2009
Posts: 2
Default Alright, I figured it out.

So first thing, instead of putting the navigation bar in your view, and then adding the view to your window, you want to open your MainWindow .nib, and add a Navigation Controller there.

In your application delegate, add

Code:
IBOutlet UINavigationController* navControl;
and

Code:
@property (nonatomic, retain) IBOutlet UINavigationController* navControl;
to the header file, then synthesize that in your .m file.

In Interface Builder, drag a Navigation Controller from the library, and drop it into the inspector. Context click and drag from your app delegate to your navigation bar, and connect it to your IBOutlet.

Finally just add

Code:
[window addSubview:[navControl view]];
to your applicationDidFinishLaunching method, and everything will be aligned the way it needs to be.

The takeaway I think is to use the right View Controllers, and let them deal with their own alignment.
fnerg is offline   Reply With Quote
Old 01-28-2010, 05:11 PM   #17 (permalink)
Registered Member
 
Join Date: Jan 2010
Posts: 1
Default

The following code solve it for me:

Code:
- (void)viewWillAppear:(BOOL)animated {
	// to fix the controller showing under the status bar
	self.view.frame = [[UIScreen mainScreen] applicationFrame];
}
Sayid Cohen is offline   Reply With Quote
Old 02-19-2010, 02:42 PM   #18 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 13
Default

...sorry, I meant to reply under thread
http://www.iphonedevsdk.com/forum/ip...tml#post174213

Last edited by Dr.Lightning; 02-19-2010 at 02:45 PM.
Dr.Lightning is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 260
24 members and 236 guests
@sandris, ADY, Dani77, diyora, FAED, fredidf, F_Bryant, GHuebner, HDshot, iDifferent, JamesCahall, JasonR, mer10, Oral B, prchn4christ, Rudy, smithdale87, Speed, spiderguy84, stekki, tgjorgoski, Touchmint, twerner, vigu360
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,880
Threads: 89,228
Posts: 380,754
Top Poster: BrianSlick (7,129)
Welcome to our newest member, @sandris
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:07 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0