Ir para conteúdo
Visualizar no app

Uma forma melhor de navegar. Saiba mais.

MM Fórum

Um app em tela cheia na sua Tela de Início com notificações push, avisos e mais.

Para instalar este app no iOS/iPadOS
  1. Toque no ícone de Compartilhamento no Safari
  2. Role o menu e toque em Adicionar à Tela de Início.
  3. Toque em Adicionar no canto superior direito.
Para instalar este app no Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

TextField dentro de AlertViews?

Featured Replies

Postado

Já vi que é possível, e já consegui aplicar, mas não consigo utilizar o valor digitado no TextField do AlertView...

Bom, aí está o código, pra quem quiser ver:

- (IBAction)buttonPressed:(id)sender{
	UIAlertView *alert = [[[UIAlertView alloc]initWithTitle:@"Enter password"
													message:@" "
												    delegate:self
												    cancelButtonTitle:@"Add"
													otherButtonTitles:@"Cancel",nil]autorelease];

	UITextField *tagField = [[[UITextField alloc]

	initWithFrame:CGRectMake(20.0, 45.0, 245.0, 25.0)]
                            autorelease];

	// tagField.

	tagField.backgroundColor = [UIColor whiteColor];

	tagField.tag = 10;
	tagField.keyboardType = UIKeyboardTypeAlphabet;
        tagField.secureTextEntry = YES;


	[alert show];

	[alert addSubview:tagField];


	/*if (tagField.text = "Un1v3rs0") {
		lockView.hidden = NO;
		unlockView.hidden = YES;
	}
	 */
}	


- (void)alertView:(UIAlertView *)alertView willDismissWithButtonIndex:(NSInteger)buttonIndex {
	//the add button
	UITextField *tagName = (UITextField*)[alertView viewWithTag:10];
	if(buttonIndex == 0) {
		if(tagName.text != nil) {
			// do some tag adding
		}
	}
	[tagName removeFromSuperview];
}

Obrigado pela atenção!

Editado por Gabriel Vincent

  • Visualizações 539
  • Criado
  • Última resposta

Participe do debate

Você pode postar agora e se registrar depois. Se você tem uma conta, entre agora para postar com ela.

Visitante
Responder este tópico…

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conta

Navegação

Buscar

Buscar

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.