<div class="it610-blog-content-contain" ></div>// ViewController.m
// Reservation software
//
// Created by 张亚雄 on 15/6/2.
// Copyright (c) 2015年 张亚雄. All rights reserved.
//
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// 本。导航栏。 头文字
self.navigationItem.title = @"订餐";
//本,导航控制器背景颜设置为黑
[self.navigationController.navigationBar setBarTintColor:[UIColor blackColor]];
//本,导航控制器标题文字颜
[self.navigationController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],NSForegroundColorAttributeName,nil]];
//调取整体长宽高
double width = self.view.frame.size.width;
//设置button按钮
[self create_button: width :@selector(order_button_pressed: ) :100 :@"帮订餐"];
controller翻译中文
[self create_button: width :@selector(look_up_ordered_restaurant:) :150 :@"看订餐"];
//设置button按钮颜。
UIViewController *viewController = [[UIViewController alloc]init];
viewController.view.backgroundColor = [UIColor whiteColor];
//push到子页页面
[self.navigationController pushViewController:viewController animated:YES];}
//设置各个button边框。
-
(UIButton *)create_button : (double)width : (SEL)btn_pressed : (double)y : (NSString * )title
{
UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
[button setTitle:title forState:UIControlStateNormal];
[button aTarget:self action:btn_pressed forControlEvents:UIControlEventTouchUpInside];
button.frame = CGRectMake(width/8,y , 3*width/4, 35);
button.layer.borderWidth = 1.0;
button.layer.borderColor = [UIColor grayColor].CGColor;
Radius = 10.0;
[self.view aSubview:button];
return button;
}
//设置button源
-(void)order_button_pressed:(id)sender

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。