0

2 つの異なる xcode プロジェクトがあります。1つはメインアプリで、完全なデザインの準備が整い、いくつかの画面を切り替えます。次に、近くの病院などを表示する位置情報アプリを用意しました。メインアプリのボタンを押すと、位置情報アプリに移動します。そこで、2 つのプロジェクトを 1 つにまとめました。最終的には機能しましたが、位置情報アプリをボタンにリンクしようとすると機能しますが、全画面表示になりません。病院や医者などのテーブルが表示されるだけですが、位置情報アプリの全画面を表示したいです。そして、それはrootviewcontrollerだと思いました。コードは次のとおりです。

.h ファイル

#import <UIKit/UIKit.h>
#import "VacaturesViewController.h"
#import "Over.h"
#import "RootViewController.h"
#import <CoreData/CoreData.h>
#import "NewKeywordViewController.h"

@interface Home : UIViewController {

//UI Button instance variable
UIButton *tweetButton;



}

// Properties
@property (nonatomic, strong) IBOutlet UIButton *tweetButton;




// Methods
-(IBAction)sendTweet:(id)sender;
-(IBAction)vacatures;
-(IBAction)zoeken;
-(IBAction)Over;

そして .m ファイル:

#import "Home.h"
#import "RootViewController.h"
#import "Reachability.h"
#import "AppDelegate.h"
#import "MapViewController.h"
#import "InfoViewController.h"
#import "Keyword.h"





@interface Home ()

@end

@implementation Home

@synthesize tweetButton;




-(IBAction)vacatures {

    VacaturesViewController *screen = [[VacaturesViewController alloc] initWithNibName:nil       bundle:nil];
screen.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentModalViewController:screen animated:YES];


}

-(IBAction)zoeken {

RootViewController *screen = [[[RootViewController alloc] initWithNibName:nil bundle:nil]   autorelease];
[self presentModalViewController:screen animated:YES];

}

-(IBAction)Over {

Over *screen = [[Over alloc] initWithNibName:nil bundle:nil];
screen.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentModalViewController:screen animated:YES];


}





-(IBAction)sendTweet:(id)sender
{
NSString *tweet = [[NSString alloc] initWithString:@"Door de Thuiszorg applicatie heb ik   altijd de juiste zorg in de buurt! Downloaden dus!"]; // Creates the string that is used for the tweet.
{
    TWTweetComposeViewController *tweeter = [[TWTweetComposeViewController alloc] init];    // Allocates and initialises the Tweet "view".
    [tweeter setInitialText:tweet]; // Sets the text of the tweet to be that of the   NSString *tweet
    [self presentModalViewController:tweeter animated:YES]; //Present the Tweet view to   the user.
}
}

- (void)viewDidLoad
{
[super viewDidLoad];



    // Do any additional setup after loading the view, typically from a nib.
}

- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:  (UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}



@end

皆さんが私を助けてくれることを願っています!

4

2 に答える 2

2

これを行うだけで、ルート ビュー コントローラーを変更できます。

 Over *screen = [[Over alloc] initWithNibName:@"Over" bundle:nil];
[[AppDelegate application].window.rootViewController = over;
于 2012-04-23T12:58:25.773 に答える
0

これを変える

-(IBAction)Over {

Over *screen = [[Over alloc] initWithNibName:nil bundle:nil];
screen.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentModalViewController:screen animated:YES];


}

これに

-(IBAction)OverView {

Over *screen = [[Over alloc] initWithNibName:nil bundle:nil];
screen.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentModalViewController:screen animated:YES];


}

ボタン アクションを Over の反対側の「OverView」に接続します。

于 2012-04-23T12:43:51.310 に答える