LTBounceSheetDemo (like logout), how to log out on QQ

Source: Internet
Author: User

LTBounceSheetDemo (like logout), how to log out on QQ

Click anywhere:

Click "cancel" or "exit:

Engineering Drawing:

Code:

RootViewController. h

 

# Import <UIKit/UIKit. h> // Add the header file # import "LTBounceSheet. h "// define file # 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

// Click anywhere. The sheet-(void) touchesBegan :( NSSet *) touches withEvent :( UIEvent *) event {// sheet = [[LTBounceSheet alloc] initWithHeight: 250 bgColor: [UIColor whiteColor]; sheet. alpha = 1; // The background backView = [[UIView alloc] initWithFrame: CGRectMake (0, 0,320,600)]; backView. alpha = 0.3; backView. backgroundColor = [UIColor blackColor]; [self. view addSubview: backView]; // The UITextView * QuitTextView = [[UITextView alloc] initWithFrame: CGRectMake (46, 13,233, 38)]; QuitTextView is displayed. text = @ "no historical records will be deleted after exiting. You can still use this account for the next login. "; QuitTextView. textColor = [UIColor grayColor]; QuitTextView. userInteractionEnabled = NO; QuitTextView. textAlignment = align; [sheet addView: QuitTextView]; // exit button UIButton * QuitButton = [[UIButton alloc] initWithFrame: CGRectMake (50, 75,230, 38)]; [QuitButton addTarget: self action: @ selector (doClickQuitButton :) forControlEvents: UIControlEventTouchDown]; [QuitButton setTitle: @ "exit" forState: UIControlStateNormal]; QuitButton. backgroundColor = [UIColor redColor]; [sheet addView: QuitButton]; // cancel the UIButton * CancelButton = [[UIButton alloc] initWithFrame: CGRectMake (50,125,230, 38)]; [CancelButton addTarget: self action: @ selector (doClickCancelButton :) forControlEvents: UIControlEventTouchDown]; [CancelButton setTitle: @ "cancel" forState: UIControlStateNormal]; CancelButton. backgroundColor = [UIColor blueColor]; [sheet addView: CancelButton]; [self. view addSubview: sheet]; [sheet show] ;}# pragma-mark-doClickActions // exit button-(void) doClickQuitButton :( UIButton *) btn {[sheet hide]; [backView setHidden: YES]; // exit Operation} // cancel button-(void) doClickCancelButton :( UIButton *) btn {[sheet hide]; [backView setHidden: YES]; // cancel the operation}

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.