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 07-07-2010, 01:34 PM   #1 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 24
rmatakajr is on a distinguished road
Default Newbie Help Auto Center on Landscape Mode

HI

IM new to the iphone sdk, i have been winging it for the past week making changes on an application that has been built for me. I am having some issues here and im hoping someone can help me out

When the App is in portrait mode it is correct as below



Ok now i was struggling pretty hard here that when i called the MVmovie player it would load the movie (which it does horayy!) But I only
wanted the the movie player itself to auto rotate, not the video view above

Well after struggling with that for 2 days and having no luck whatsoever, i decided id make the whole app be autorotate compatible

So here is the shot when i have the video view in landscape




As you can see the Menu Items are crunched to the left side, so is the title etc... leaving a big black space the right of the app

is there any techniques i can use to auto center the view on landscape mode, the previous developer used all locked coords for

the portrait mode and im not sure how i can dynamically center the menu and titles


Here is the code clip

Code:
videosView=[[UIView alloc]initWithFrame:CGRectMake(0,0,kViewWidth, kViewHeight)]; //which is 420 X 380
videosView.backgroundColor=[UIColor blackColor];


self.view =videosView;
CGRect frame=CGRectMake(0, 0,1024,44); // I changed that to 1024, it was 300
imgViewTopbar=[[UIImageView alloc]initWithFrame:frame];
imgViewTopbar.image=[UIImage imageNamed:@"topBar.png"];
[self.view addSubview:imgViewTopbar];


// Here is the title


lblTitle=[[UILabel alloc]initWithFrame:CGRectMake(60,5,200,30)];
lblTitle.text=@"";
lblTitle.backgroundColor=[UIColor clearColor];
lblTitle.textColor=[UIColor whiteColor];
lblTitle.textAlignment=UITextAlignmentCenter;
lblTitle.font=[UIFont boldSystemFontOfSize:kTitleLabelFontSize];
[self.view addSubview:lblTitle];
[lblTitle release];

Well i guess you get the hint... He ued locked coords.. how to i change that to be dynamic

Im running in circles here!!


Thanks for your help


Ricky
rmatakajr is offline   Reply With Quote
Old 07-07-2010, 08:27 PM   #2 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 24
rmatakajr is on a distinguished road
Default

BUMP
rmatakajr 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: 330
9 members and 321 guests
bignoggins, Chickenrig, firecall, givensur, iNet, michaelhansen, Objective Zero, PlutoPrime, stanny
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,657
Threads: 94,118
Posts: 402,893
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jenniead38
Powered by vBadvanced CMPS v3.1.0

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