//記得加入UIAlertViewDelete@interfaceCustomAlertViewViewController:UIViewController{UIAlertView*myAlertView;}@property(nonatomic" />

欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

進階AlertView運用 - 登入設計

系統 1930 0

說明:示范如何利用AlertView來制作系統登入的介面
進階AlertView運用 - 登入設計


程式碼:
CustomAlertViewViewController.h


?

    #import <UIKit/UIKit.h>



//記得加入UIAlertViewDelete

@interface CustomAlertViewViewController : UIViewController<UIAlertViewDelegate> {

    UIAlertView *myAlertView;

}



@property (nonatomic,retain) UIAlertView *myAlertView;



-(IBAction) buttonPressed:(id)sender;



@end



CustomAlertViewViewController.m 


-(IBAction) buttonPressed:(id)sender{

    myAlertView=[[UIAlertView alloc] initWithTitle:@"系統登入" message:nil delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"登入",nil];

    [myAlertView show];

    [myAlertView release];

    

}



- (void)willPresentAlertView:(UIAlertView *)alertView

{

        CGRect frame = alertView.frame;

        if( alertView==myAlertView )

        {

                frame.origin.y -= 120;

                frame.size.height += 80;

                alertView.frame = frame;

                for( UIView * view in alertView.subviews )

                {

            //列舉alertView中所有的物件

                        if( ![view isKindOfClass:[UILabel class]] )

                        {

            //若不UILable則另行處理

                if (view.tag==1)

                {

                //處理第一個按鈕,也就是 CancelButton

                           CGRect btnFrame1 =CGRectMake(30, frame.size.height-65, 105, 40);

                                view.frame = btnFrame1;

               

                } else if  (view.tag==2){

                //處理第二個按鈕,也就是otherButton    

                    CGRect btnFrame2 =CGRectMake(142, frame.size.height-65, 105, 40);

                    view.frame = btnFrame2;               

                }

                        }

                }

                

        //加入自訂的label及UITextFiled

        UILabel *lblaccountName=[[UILabel alloc] initWithFrame:CGRectMake( 30, 50,60, 30 )];;

        lblaccountName.text=@"帳號:";

        lblaccountName.backgroundColor=[UIColor clearColor];

        lblaccountName.textColor=[UIColor whiteColor];

        

        UITextField *accoutName = [[UITextField alloc] initWithFrame: CGRectMake( 85, 50,160, 30 )];   

        accoutName.placeholder = @"帳號名稱";

        accoutName.borderStyle=UITextBorderStyleRoundedRect;

        

        

        UILabel *lblaccountPassword=[[UILabel alloc] initWithFrame:CGRectMake( 30, 85,60, 30 )];;

        lblaccountPassword.text=@"密碼:";

        lblaccountPassword.backgroundColor=[UIColor clearColor];

        lblaccountPassword.textColor=[UIColor whiteColor];

        

        UITextField *accoutPassword = [[UITextField alloc] initWithFrame: CGRectMake( 85, 85,160, 30 )];   

        accoutPassword.placeholder = @"登入密碼";

        accoutPassword.borderStyle=UITextBorderStyleRoundedRect;

        //輸入的資料以星號顯示(密碼資料)

        accoutPassword.secureTextEntry=YES;

        

             [alertView addSubview:lblaccountName];

                [alertView addSubview:accoutName];         

        [alertView addSubview:lblaccountPassword];

                [alertView addSubview:accoutPassword];

        }

}



- (void)dealloc {

    [myAlertView release];

    [super dealloc];

}

  

?

進階AlertView運用 - 登入設計


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 久久久精品免费热线观看 | 天堂资源最新在线 | 天天影院成人免费观看 | 午夜影视免费片在线观看 | 96自拍视频 | 性生潮久久久不久久久久 | 狠狠操麻豆 | 日韩在线aⅴ免费视频 | 俄罗斯色妞18av| 黄色片免费在线播放 | 久草首页在线观看 | 男女爽爽无遮挡午夜动态图 | 欧美中文在线视频 | 精品一区二区三区在线视频 | 日韩黄色一级视频 | 亚洲视频在线视频 | 国产精品久久久久一区二区 | 亚洲精品综合久久 | 天天曰天天射 | 日本三级韩国三级香港三级 | 丝袜美腿视频一区二区三区 | 久久小视频 | 色综合色综合网色综合 | 99这里只有精品视频 | 九色视频网站 | 成人免费网址在线 | 日韩国产在线观看 | 91婷婷射| 毛片99| 99久久九九爱看免费直播 | 一区二区中文字幕 | 在线中文字幕视频 | 日韩精品在线视频 | 草久视频在线 | 国产女人与拘做受视频 | 波多野结衣在线网站 | 97婷婷狠狠成人免费视频 | 波多野结衣一区二区三区在线观看 | 欧美色偷偷亚洲天堂bt | 天天爱天天做久久天天狠狼 | 韩国A片国产浪潮AV 久久99国产精品 |