编辑重写的问题:
您好,我正在研究另一个学生的项目(接管),没有主要的故事板,只有一个viewonctroller.Xib在资源下Viewcontroller.h和.m
我正在尝试添加新按钮,但它们没有显示。我将新按钮链接到viewcontroller.h和.m文件,代码中没有实际代码,如
-(IBAction)button { empty }
<。>在.h文件中
IBOutlet UIButton *button;
按钮没有显示在模拟器中,但是,前一个学生的应用程序中的每个按钮都显示在同一个窗口中,只是使用setHidden函数来区分游戏中的菜单。我想也许按钮就在其他按钮后面,但是当我去编辑 - &gt;发送到前面的选项显示为灰色。
edit Sample code of ViewController.H
#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>
#import <QuartzCore/QuartzCore.h>
// Game Center -- ignore and or delete
#import <GameKit/GameKit.h>
#import "GameCenterManager.h"
@interface SideWinderViewController : UIViewController <AVAudioPlayerDelegate, /*ADBannerViewDelegate,*/ UIActionSheetDelegate, GKLeaderboardViewControllerDelegate,
GKAchievementViewControllerDelegate, GameCenterManagerDelegate> {
// Game Center
GameCenterManager *gameCenterManager;
int64_t currentScore;
NSString* currentLeaderBoard;
IBOutlet UILabel *currentScoreLabel;
// End Game Center
IBOutlet UIImageView *ballpng;
IBOutlet UILabel *displaycredit2;
IBOutlet UILabel *displaycredits;
IBOutlet UIButton *easy;
IBOutlet UIButton *medium;
IBOutlet UIButton *hard;
IBOutlet UILabel *displayhighscore;
IBOutlet UILabel *Howtoplay;
IBOutlet UIButton *back;
IBOutlet UIButton *info;
IBOutlet UIButton *playbutton_mainmenu;
IBOutlet UIImageView *winder1;
IBOutlet UIImageView *socket1;
IBOutlet UIImageView *wheelcontrol2;
IBOutlet UILabel *seconds;
IBOutlet UILabel *scoreLabel;
IBOutlet UIButton *Restart;
IBOutlet UIButton *HIGHSCORE;
IBOutlet UIButton *pausebutton;
IBOutlet UIButton *resumebutton;
IBOutlet UIButton *gameStartButton;
IBOutlet UIImageView *mainmenu;
IBOutlet UIButton *credits;
IBOutlet UIButton *returnt
.m
的示例代码#import <UIKit/UIKit.h>
#import "SideWinderViewController.h"
#import <QuartzCore/QuartzCore.h>
#import "Ball.h"
#import <AVFoundation/AVAudioPlayer.h>
// Game Center -- ignore and or delete
#import "AppSpecificValues.h"
#import "GameCenterManager.h"
// End Game Center
@implementation SideWinderViewController
-(void)viewDidLoad {
[Restart setHidden:NO];
...
答案 0 :(得分:-1)
这足以显示一个按钮 检查