1. 设置导航栏标题:Navigation Item->Title:我的彩票

2. ”客服“按钮

  2.1 添加按钮:View Controller Navigation左侧->拖进Button->Button->Type:Custom;Title:客服;Image:FBmm_Barbutton

  2.2 设置”客服“按钮Title和Image之间的间距:Button->Edge:Title->Inset->Left:4

  2.3 调整按钮宽度:View->Width:53

3. ”设置“按钮:”我的彩票“View Controller Navigation右侧->拖进Mytottery_config

4. ”千万大奖 一触即发“图片

  View Controller->拖进view->调整位置->自动布局:上,宽,高;居中->Backgrourd:

5. ”网易邮箱账号可以直接登录“

  View Controller->拖进Label->Text:网易邮箱账号可以直接登录

  自动布局:上,宽,高;居中

6. ”登录“按钮

  View Controller->拖进Button->Type:Custom;Title:登录;Backgrourd:RedButton

  按钮宽度等同View两侧

  自动布局:上,左,右,高

7. 切割”登录“按钮

  7.1 新建Cocoa Touch Class(Class:HMMyLotteryController;Subclass of:UIViewController;Language:Objective-C)

  路径:Classes->MYLottery(我的彩票)->Controller

  ”我的彩票“View Controller绑定该类

7.2 切割”登录“按钮

  ”登录“按钮->拖线->HMMyLotteryController.m->@property (weak, nonatomic) IBOutlet UIImageView *loginButton

  实现代码如下:

- (void)viewDidLoad
{
    //获取图片
    UIImage *image = [UIImage imageNamed:@"RedButton"];
    //中间1像素拉伸
    image = [image stretchableImageWithLeftCapWidth:image.size.width * 0.5
                           topCapHeight:image.sixe.height * 0.5];
    //设置按钮正常的背景图片
    [self.loginButton setBackgroupImage:image forState:UIControlStateNormal];
    
    //获取图片
    UIImage *imagePressed = [UIImage imageNamed:@"RedButtonPressed"];
    //中间1像素拉伸
    imagePressed = [imagePressed stretchableImageWithLeftCapWidth:imagePressed.size.width * 0.5 topCapHeight:imagePressed.size.herght * 0.5];
    //设置按钮的背景图片
    [self.loginButton setBackgroundImage:imagePressed forState:UIControlStateHighted];
}
View Code