如何在iphone中放置菜单按钮

如何在iphone中放置菜单按钮,iphone,Iphone,我需要在iphone中放置菜单按钮 我对安卓有一些了解 在android中,我通过按menu来显示 是否可以处理iphone菜单按钮 如果不是,我可以把这些放在哪里 提前感谢您。我认为使用Xcode和Interface Builder(iPhone的开发平台),完成这项任务会更加简单 作为iPhone应用程序UI设计的简要介绍,要将此选项卡栏(正如您所放置的,菜单)放置在视图上,您只需从库中选择一个选项卡栏,并将其放置在nib文件的视图上。您还可以通过单击并拖动,将这样的选项卡栏与一些负责内部逻

我需要在iphone中放置菜单按钮

我对安卓有一些了解

在android中,我通过按menu来显示

是否可以处理iphone菜单按钮

如果不是,我可以把这些放在哪里


提前感谢您。

我认为使用Xcode和Interface Builder(iPhone的开发平台),完成这项任务会更加简单

作为iPhone应用程序UI设计的简要介绍,要将此选项卡栏(正如您所放置的,菜单)放置在视图上,您只需从库中选择一个选项卡栏,并将其放置在nib文件的视图上。您还可以通过单击并拖动,将这样的选项卡栏与一些负责内部逻辑的代码连接起来。很简单


顺便说一句,nib文件只是Xcode和Interface Builder用来保存UI数据的某种文件格式。

iPhone没有专用的滑出菜单-所有内容都始终在屏幕上,并且没有专门构建的按钮(如“返回”和“主页”)


您应该始终在屏幕上显示您的操作,或者如果这些操作不重要或不常见,请将它们隐藏在另一个操作按钮(如+或扳手图标)后面。

您应该使用与菜单项相同的图像,并将自定义按钮放在图像上。这是显示所需菜单的唯一方法


Iphone sdk提供了选项卡和工具栏,你也可以在自定义表单中使用这些。这是制作菜单的正确方法。Iphone设计模式比android有很多优势,因此你可以轻松地在Iphone中制作每件东西,但你不能让android中的每件东西都与Iphone相同。Iphone具有国际标准,因此必须使用Iphone的控件

使用round rect按钮并将属性更改为custom place,将图像作为按钮的背景图像在主页中的更多菜单项中执行此操作

这是我处理菜单项的方式……

.h

IBOutlet UIScrollView *scrollView;

@property ( nonatomic , retain )  IBOutlet UIScrollView *scrollView;

-(void)AppleVijayAtFacebookDotCom:(id)sender;

-(void)createMenuWithButtonSize:(CGSize)buttonSize withOffset:(CGFloat)offset noOfButtons:(int)totalNoOfButtons;
m

输出


很抱歉,你必须重新表述这个问题,我才能理解。
@synthesize scrollView;



-(void)AppleVijayAtFacebookDotCom:(id)sender{


    NSLog(@"AppleVijayAtFacebookDotCom called");


    UIButton *button=(UIButton *)sender;


    if (button.tag == 0) {

        NSLog(@"hey have clicked first button, this is my tag : %i \n\n",button.tag);
    }
    else if (button.tag == 1) {

        NSLog(@"hey have clicked second button, this is my tag : %i \n\n",button.tag);

    }
    // ......like this

    NSLog(@"button clicked is : %iBut \n\n",button.tag);



}       



-(void)createMenuWithButtonSize:(CGSize)buttonSize withOffset:(CGFloat)offset noOfButtons:(int)totalNoOfButtons{

for (int i = 0; i < totalNoOfButtons; i++) {

    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];

    [button addTarget:self action:@selector(AppleVijayAtFacebookDotCom:) forControlEvents:UIControlEventTouchUpInside];

        //[button1 setImage:[UIImage imageNamed:@"Button.png"] forState:UIControlStateNormal];//with image

        //OR

    [button setTitle:[NSString stringWithFormat:@"%iBut",i] forState:UIControlStateNormal];//with title

    button.frame = CGRectMake(i*(offset+buttonSize.width), 8.0, buttonSize.width, buttonSize.height);

    button.clipsToBounds = YES;

    button.showsTouchWhenHighlighted=YES;

    button.layer.cornerRadius = 10;//half of the width

    button.layer.borderColor=[UIColor redColor].CGColor;

    button.layer.backgroundColor=[UIColor blackColor].CGColor;

    button.layer.borderWidth=2.0f;

    button.tag=i;

    [self.scrollView addSubview:button];

}

self.scrollView.contentSize=CGSizeMake((buttonSize.width + offset) * totalNoOfButtons, buttonSize.height);

    //self.navigationItem.titleView=self.scrollView;//if u have navigationcontroller then enable this line
in viewDidLoad call 

[self createMenuWithButtonSize:CGSizeMake(70.0, 30.0) withOffset:20.0f noOfButtons:30];