LTBounceSheetDemo(仿退出登入),手機qq怎麼退出登入

來源:互聯網
上載者:User

LTBounceSheetDemo(仿退出登入),手機qq怎麼退出登入

點擊任何處:

點擊“取消”或“退出”的:

工程圖:

代碼:

RootViewController.h

 

#import <UIKit/UIKit.h>//加入標頭檔#import "LTBounceSheet.h"//define檔案#define color [UIColor colorWithRed:0/255.0 green:175/255.0 blue:240/255.0 alpha:1]@interface RootViewController : UIViewController{    UIView *backView;    LTBounceSheet *sheet;}@end

 

RootViewControlle.rm

//點擊任何處,彈出sheet-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{        //sheet    sheet = [[LTBounceSheet alloc]initWithHeight:250 bgColor:[UIColor whiteColor]];    sheet.alpha=1;        //背景    backView= [[UIView alloc]initWithFrame:CGRectMake(0, 0, 320, 600)];    backView.alpha=0.3;    backView.backgroundColor = [UIColor blackColor];    [self.view addSubview:backView];        //提示    UITextView *QuitTextView = [[UITextView alloc]initWithFrame:CGRectMake(46, 13, 233, 38)];    QuitTextView.text = @"退出後不會刪除任何記錄,下次登入依然可以使用本帳號.";    QuitTextView.textColor = [UIColor grayColor];    QuitTextView.userInteractionEnabled =NO;    QuitTextView.textAlignment = NSTextAlignmentCenter;    [sheet addView:QuitTextView];        //退出按鈕    UIButton *QuitButton = [[UIButton alloc]initWithFrame:CGRectMake(50, 75, 230, 38)];    [QuitButton addTarget:self action:@selector(doClickQuitButton:) forControlEvents:UIControlEventTouchDown];    [QuitButton setTitle:@"退出" forState:UIControlStateNormal];    QuitButton.backgroundColor=[UIColor redColor];    [sheet addView:QuitButton];        //取消按鈕    UIButton *CancelButton =[[UIButton alloc]initWithFrame:CGRectMake(50, 125, 230, 38)];    [CancelButton addTarget:self action:@selector(doClickCancelButton:) forControlEvents:UIControlEventTouchDown];    [CancelButton setTitle:@"取消" forState:UIControlStateNormal];    CancelButton.backgroundColor=[UIColor blueColor];    [sheet addView:CancelButton];        [self.view addSubview:sheet];    [sheet show];    }#pragma -mark -doClickActions//退出按鈕-(void)doClickQuitButton:(UIButton *)btn{    [sheet hide];    [backView setHidden:YES];    //執行退出的操作}//取消按鈕-(void)doClickCancelButton:(UIButton *)btn{    [sheet hide];    [backView setHidden:YES];    //執行取消的操作}

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.