Thursday 15 July 2010

ios - UITextField not selectable -



ios - UITextField not selectable -

i'm attempting create sign in screen app i'm working on. right have 2 uitextfields image view behind them. when seek click on text field come in text, nil happens. i've spent lot of time trying figure out problem can't find has had similar problem. in loginviewcontroller's viewdidload method have next code:

`

[super viewdidload]; uiimageview *splashview = [[uiimageview alloc] initwithframe:self.view.frame]; splashview.image = [uiimage imagenamed:@"default-568h@2x.png"]; uitextfield *username = [[uitextfield alloc] initwithframe:cgrectmake(90, 320, 140, 30)]; username.placeholder = @"username"; username.borderstyle = uitextborderstyleroundedrect; username.returnkeytype = uireturnkeydone; username.textalignment = nstextalignmentleft; username.userinteractionenabled = yes; [splashview addsubview:username]; uitextfield *password = [[uitextfield alloc] initwithframe:cgrectmake(90, 365, 140, 30)]; password.placeholder = @"password"; password.borderstyle = uitextborderstyleroundedrect; password.textalignment = nstextalignmentleft; [splashview addsubview:password]; [self.view addsubview:splashview]; `

any help or advice appreciated thanks.

change place add together image:

[super viewdidload]; uiimageview *splashview = [[uiimageview alloc] initwithframe:self.view.frame]; splashview.image = [uiimage imagenamed:@"default-568h@2x.png"]; // image behind [self.view addsubview:splashview]; uitextfield *username = [[uitextfield alloc] initwithframe:cgrectmake(90, 320, 140, 30)]; username.placeholder = @"username"; username.borderstyle = uitextborderstyleroundedrect; username.returnkeytype = uireturnkeydone; username.textalignment = nstextalignmentleft; username.userinteractionenabled = yes; // alter [self.view addsubview:username]; uitextfield *password = [[uitextfield alloc] initwithframe:cgrectmake(90, 365, 140, 30)]; password.placeholder = @"password"; password.borderstyle = uitextborderstyleroundedrect; password.textalignment = nstextalignmentleft; //and alter [self.view addsubview:password];

if image other textfield add together view first this.

ios objective-c uitextfield textfield viewdidload

No comments:

Post a Comment