Use of presentation controllers (ii)

Source: Internet
Author: User

Use of presentation controllers (ii) by Wusheying



Model Past:
-(Ibaction) show: (ID) Sender {    Secondviewcontroller *overlay = [[Secondviewcontroller alloc] initwithcountry];    [Self presentviewcontroller:overlay animated:yes completion:nil];}

Secondviewcontroller.m
-(Instancetype) Initcontentview {self = [super init];        if (self) {[self setmodalpresentationstyle:uimodalpresentationcustom];        Self.view.backgroundColor = [Uicolor Clearcolor];        Self.contentcontainerview = [[UIView alloc] Initwithframe:cgrectmake (20, 200, 280, 200)];        Self.contentContainerView.backgroundColor = [Uicolor colorwithwhite:0.0 alpha:0.8];        Self.contentContainerView.layer.cornerRadius = 5.0;               [Self.view AddSubview:self.contentContainerView];        Self.closebutton = [UIButton Buttonwithtype:uibuttontypesystem];        Self.closeButton.frame = CGRectMake (30, 30, 100, 100);        Self.closeButton.tintColor = [Uicolor Whitecolor];        Self.closeButton.titleLabel.font = [Uifont systemfontofsize:13];        [Self.closebutton settitle:@ "Close" forstate:uicontrolstatenormal]; [Self.closebutton addtarget:self Action: @selector (closebuttonpressed:) forControlEvents:        UIControlEventTouchUpInside]; [Self.contentcontaineRview AddSubview:self.closeButton]; } return self;} -(void) closebuttonpressed: (UIButton *) Sender {[Self.presentingviewcontroller dismissviewcontrolleranimated:yes Completion:nil];}


Use of presentation controllers (ii)

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.