嘿,我正在制作基于视图的应用程序.对于其中一个xib文件,我希望它仅以横向模式显示.我该怎么做呢?
嘿! 我有一个xib文件,我希望一个圆形的矩形按钮在按下后保持高亮显示.我也希望在第一个按钮后按下一个不同的按钮,将您带到下一页.我怎样才能做到这一点.一些代码将不胜感激!
这是我的.h:
#import <UIKit/UIKit.h>
@interface Test1ViewController : UIViewController {
IBOutlet UIButton *button1;
IBOutlet UIButton *button2;
}
-(IBAction) buttonPressed:(id)sender;
-(IBAction) secondButtonPressed:(id)sender;
- (void)flipButton;
@end
Run Code Online (Sandbox Code Playgroud)
这是我的.m:
#import "Test1ViewController.h"
#import "Page2.h"
@implementation Test1ViewController
-(IBAction)buttonPressed:(id)sender
{
[self performSelector:@selector(flipButton) withObject:nil afterDelay:0.0];
}
- (IBAction)secondButtonPressed {
if ( button1.selected ) {
Page2 *page2 = [[Page2 alloc] initWithNibName:@"Page2" bundle:nil];
page2.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:page2 animated:YES];
[page2 release];
}
}
/*
// The designated initializer. Override to perform setup that is required before the view is loaded. …Run Code Online (Sandbox Code Playgroud) #include <stdio.h>
float function (float x, float y);
float function2 (float x, float z);
float function3 (float y, float z);
float main()
{
float x;
float y;
float z;
{
printf("Please insert length of adjacent side");
scanf("%f", &x);
printf("Please insert length of opposite side");
scanf("%f", &y);
printf("Please insert length of the hypotenuse");
scanf("%f", &z);
}
{
if (z = 0){
printf("The length of the hypotenuse is %f", function (x, y));}
else if (y = 0){
printf("The length of the opposite …Run Code Online (Sandbox Code Playgroud)