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

亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

進階AlertView運用 - 登入設(shè)計

系統(tǒng) 2076 0

說明:示范如何利用AlertView來制作系統(tǒng)登入的介面
進階AlertView運用 - 登入設(shè)計


程式碼:
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:@"系統(tǒng)登入" 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運用 - 登入設(shè)計


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯(lián)系: 360901061

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

【本文對您有幫助就好】

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

發(fā)表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 国产成人精品亚洲日本在线 | 成年女人毛片免费播放人 | 日韩天堂在线观看 | 性猛交╳xxx乱大交 性猛交毛片 | 一区二区在线视频 | 欧洲一级做a爱在线观看 | 被黑人做的白浆直流在线播放 | 亚洲国产高清一区二区三区 | 黑人超长巨大xxxxxxx视频 | 99久久免费国产特黄 | aa毛片免费全部播放完整 | 国产精品一区在线麻豆 | 最新国产精品自拍 | 91国在线观看 | 四虎影院永久网址 | 嫩模一区 | 亚洲九九九 | 福利精品 | 九九色播| 天天躁狠狠躁 | 亚洲福利精品一区二区三区 | 亚洲一区二区三区视频 | 8090成人午夜精品 | 亚洲精品一区二区在线播放 | 一级黄色录像视频 | 亚洲国产成人久久综合区 | 国产精品久久久久免费视频 | 91视频网址 | 久久色精品| 亚洲国产一区视频 | 大片刺激免费播放视频 | 四虎永久在线精品影院 | 色综合天天综合高清网国产 | 日韩 视频在线播放 | 欧美 国产 日本 | 国产精品久久久久久久牛牛 | 午夜成人免费影院 | 国产线路一 | 一本岛高清v不卡免费一三区 | 精品亚洲无人区一区二区 | 青青青青久久精品国产h |