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

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

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

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.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 06-03-2010, 02:27 AM   #1 (permalink)
Registered Member
 
Join Date: May 2010
Posts: 4
asadqamber is on a distinguished road
Default Subview vertical position after rotation change

I have a viewController and have added a subview in it programatically.

Code:
     secondView.autoresizingMask =  UIViewAutoresizingFlexibleWidth;
        [self.view addSubview:secondView];


I guess when the device rotates, my mainViewController knows that orientation changed, but the subview (secondView) inside the mainViewController does not know this, so I change its frame to landscape size in willRotateToInterfaceOrientation.


Code:
      secondView.frame = CGRectMake(0, 0, 480 , 260);

This does not set in the correct position, it's 11 px below the NavigationBar.
Why does it start from 11 px below the navigation bar?

The navigation bar shrinks when we move from portrait to landscape mode and its because of this that my subview is 11px below.
asadqamber is offline   Reply With Quote
Reply

Bookmarks

Tags
frame, rotation, subview, uiorientation, y-position

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: 352
13 members and 339 guests
ajay123123, Anwerbl, Arty Tales, ashaman64, baja_yu, ChrisYates, HemiMG, mini998, mottdog, newDev, Objective Zero, oceanlablight, Steven.C
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,649
Threads: 94,113
Posts: 402,878
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Anwerbl
Powered by vBadvanced CMPS v3.1.0

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