Saturday, December 21, 2013

How to create a click of a button to open a xib interface

posts by zzxap edited 2011-06-24 14:34:04
Click the button to open the interface or how uiview
created a xib
There are two xib one is mainwindow.xib one next.lib

[Mainwindow next: oneViewController animated: YES];
Write?
Reply:
Designed to make the bottom of the wind brother?
Reply:
What xxxx.xib view called?

How to initialize this view
Reply:
cited a floor wknight_it reply:
designed to do the bottom of the wind brother?

Ah, beginner, the pressure is not small
Reply:
Just learn?
Well, you better put aside IB ⋯ ⋯
I have a reason to let you use the N code rather than using IB to build your project.

Reply:
That's CONTROLLER VIEW to define an object loaded on the OK
Reply:
I created a new class and xib

Want to click a button from another view, open the xib view

I do not know my description is not clear
Reply:
references, 5th Floor li376438624 reply:
the CONTROLLER to the VIEW definition of an object loaded on the OK

Specific code?

nextView * nextv = [[nextView alloc] init];
[Self.navigationController pushViewController: nextv animated: YES];

Tip request for member 'navigationController' in something not a structure or union

What is the reason?
Reply:
In ObjC in, UIview with UIViewController is different
You can write two UIView in a UIViewController, and then click the button to switch back and forth.
If you do not understand, I made an example out
Reply:
reference to the 8th floor ybh37 reply:
in ObjC in, UIview with UIViewController is different
You can write two UIView in a UIViewController, and then click the button to switch back and forth.
If you do not understand, I made an example out

Find examples
Reply:
Often recommended after the
http://stackoverflow.com/
Instead csdn
Here is the place to chat
Reply:
General UIViewController xib file is created or uiview?
Reply:
UIViewController
Reply:
Examples?

I still do not clear how to jump to another view
Reply:
Leave me a message, specifying the mailbox
Reply:
 
# Import "SwitchViewCtl.h"


@ Implementation SwitchViewCtl

- (Id) init {
if (self = [super init]) {
v1 = [[UIView alloc] initWithFrame: CGRectMake (0, 0, 400, 400)];
v2 = [[UIView alloc] initWithFrame: CGRectMake (0, 500, 400, 600)];
/ / Initialize two View

[V1 setBackgroundColor: [UIColor cyanColor]];
UIButton * bt = [[UIButton alloc] initWithFrame: CGRectMake (100, 250, 100, 50)];
[Bt setImage: [UIImage imageNamed: @ "114.png"] forState: UIControlStateNormal];
bt.titleLabel.text = @ "show";
[Bt addTarget: self action: @ selector (openView) forControlEvents: UIControlEventTouchDown];
[V1 addSubview: bt];
[Self.view addSubview: v1] ;/ / load a
}
return self;
}


- (Void) openView {
v1.hidden = YES ;/ / may be hiding, you can also set the Frame overwritten, of course, you can also delete [v1 removeFromSuperview] from the main ViewCtl in;

[V2 setBackgroundColor: [UIColor blueColor]];
[Self.view addSubview: v2] ;/ / load another
[Self.view setNeedsDisplay] ;/ / Here is refreshed it
}


 

- (BOOL) application: (UIApplication *) application didFinishLaunchingWithOptions: (NSDictionary *) launchOptions {

window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]];
SwitchViewCtl * switchViewCtl = [[SwitchViewCtl alloc] init];
[Window addSubview: switchViewCtl.view];

[Self.window makeKeyAndVisible];

return YES;
}


 
int main (int argc, char * argv []) {

NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain (argc, argv, nil, @ "ViewSwitchAppDelegate");
[Pool release];
return retVal;
}

This can say clearly? The project file is sent to you better
Reply:
Concerned about this issue

No comments:

Post a Comment