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 > Mac OS X Development Forums > Mac OS X Development

Reply
 
LinkBack Thread Tools Display Modes
Old 07-15-2011, 01:36 PM   #1 (permalink)
Registered Member
 
Join Date: Jun 2011
Posts: 6
Dhotiwalla is on a distinguished road
Default displayed view is much larger than specified in xib file

I am using a UITableViewController to display a table. When an item is selected in the table, I want to display a small GUI that asks for username and password. I have created the GUI using a xib file and IB and here is how I display it.

Code:
PasswordView *pv = [[PasswordView alloc] initWithNibName:@"PasswordView" bundle:[NSBundle mainBundle]];
pv.modalPresentationStyle = UIModalPresentationFormSheet;
[pv setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
[self presentModalViewController:pv animated:YES];
[pv release];
pv = nil;
The GUI is displayed correctly but the problem is that the size is way bigger than what I have set via IB.

I've even tried putting the following code in view class, but that did not help

Code:
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
    {
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        self.view.frame = CGRectMake(0, 0, 200, 200);
    }
    return self;
}
I'm using Xcode 4.0 and the target device is an iPad

thanks for your help
Dhoti
Dhotiwalla is offline   Reply With Quote
Old 07-20-2011, 05:31 PM   #2 (permalink)
Registered Member
 
Join Date: Jan 2009
Location: Long Beach, CA
Posts: 612
bytor99999 is on a distinguished road
Send a message via AIM to bytor99999 Send a message via Yahoo to bytor99999
Default

I just found this online

After the line that shows your modal view, change the view like here.

targetController.view.superview.frame = CGRectMake(0, 0, 200, 200);
//it's important to do this after presentModalViewController
targetController.view.superview.center = self.view.center;

targetController here is from the original post, but that would be your model view controller
__________________
Perfect World Programming LLC
http://www.perfectworldprogramming.com

Please check out my apps.

TubeOrganizer
http://www.spritzlerapps.com/tube-organizer.html

Paper Clips
http://spritzlerapps.weebly.com/paper-clips.html
bytor99999 is offline   Reply With Quote
Reply

Bookmarks

Tags
uiviewcontroller

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: 381
10 members and 371 guests
Creativ, Emy, husthlj, illogical, LegionMD, LunarMoon, Murphy, padsoftware, stanny, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,677
Threads: 94,127
Posts: 402,916
Top Poster: BrianSlick (7,990)
Welcome to our newest member, husthlj
Powered by vBadvanced CMPS v3.1.0

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