網易彩票-我的彩票


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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM