Artigos com a tag 'modal'

trecho de código iPhone: UIAlertView

A classe UIAletrView permite que você exiba uma janela modal (animada) para informar e / ou pedir-lhe algo. O UIAlterView (alertas de vista) são muito confortáveis ​​e fáceis de usar. A manipulação da resposta de utilizador é resolvido por interceptar o índice do botão pressionado. Para ver uma simples UIAlterView basta escrever:

1
2
3
4
/ / Alerta com um simples botão, sem retorno
[ [ UIAlertView alloc ] initWithTitle : @ "Titolo" message : @ "Messaggio" cancelButtonTitle : @ "Annulla" otherButtonTitles : nil ] ; UIAlertView MyALERT * = [[UIAlertView alloc] initWithTitle: @ "Título" mensagem: @ "Mensagem" cancelButtonTitle: @ "Cancelar" otherButtonTitles: nil];
; [MyALERT show];
; [MyALERT release];

E 'possível adicionar botões adicionais otherButtonTitles :

1
2
3
4
/ Alerta / com dois botões simples, sem retorno
[ [ UIAlertView UIAlertView MyALERT * = [[UIAlertView
; [MyALERT show];
; [MyALERT release];

: Para determinar qual botão foi pressionado, basta adicionar o delegate:self objeto de inicialização UIAlterView :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Alerta / / simples com dois botões e callbacks
[ [ UIAlertView alloc ] initWithTitle : @ "Titolo" message : @ "Messaggio" delegate : self cancelButtonTitle : @ "Annulla" otherButtonTitles : @ "Ok" , nil ] ; UIAlertView MyALERT * = [[UIAlertView alloc] initWithTitle: @ "Título" mensagem: @ "Mensagem" delegado: cancelButtonTitle self: @ "Cancelar" otherButtonTitles: @ "Ok", nil];
; [MyALERT show];
; [MyALERT release];

/ / O retorno de chamada tem a seguinte sintaxe

void ) alertView : ( UIAlertView * ) alertView clickedButtonAtIndex : ( NSInteger ) buttonIndex { - (Void) alertView: (UIAlertView *) clickedButtonAtIndex alertView: (NSInteger) {buttonIndex
buttonIndex ) { interruptores (buttonIndex) {
: case 1:
/ / Código
quebrar;
}
}

O retorno de chamada alertView precisa ter esse nome, para mais informações, consulte UIAlertViewDelegate

punteranno sempre a quella. Com apenas o callbck alertView:clickedButtonAtIndex mais UIAletrView irá sempre apontar para isso. Usando o campo de tag do objeto UIAletrView , podemos determinar o que o "chamador":

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Alerta / / simples com dois botões e callbacks
[ [ UIAlertView alloc ] initWithTitle : @ "Titolo" message : @ "Messaggio" delegate : self cancelButtonTitle : @ "Annulla" otherButtonTitles : @ "Ok" , nil ] ; UIAlertView MyALERT * = [[UIAlertView alloc] initWithTitle: @ "Título" mensagem: @ "Mensagem" delegado: cancelButtonTitle self: @ "Cancelar" otherButtonTitles: @ "Ok", nil];
; myAlertA.tag = 1;
; [MyAlertA show];
; [MyAlertA release];

/ /
[ [ UIAlertView alloc ] initWithTitle : @ "Titolo" message : @ "Messaggio" delegate : self cancelButtonTitle : @ "Annulla" otherButtonTitles : @ "Ok" , nil ] ; UIAlertView myAlertB * = [[UIAlertView alloc] initWithTitle: @ "Título" mensagem: @ "Mensagem" delegado: cancelButtonTitle self: @ "Cancelar" otherButtonTitles: @ "Ok", nil];
; myAlertA.tag = 2;
; [MyAlertB show];
; [MyAlertB release];

/ / A gestão múltipla UIAlertView

void ) alertView : ( UIAlertView * ) alertView clickedButtonAtIndex : ( NSInteger ) buttonIndex { - (Void) alertView: (UIAlertView *) clickedButtonAtIndex alertView: (NSInteger) {buttonIndex
"Alert Tag: %i" , alertView.tag ) ; NSLog (@ "Etiquetas de Alerta:% s", alertView.tag);
"buttonIndex: %i" , buttonIndex ) ; NSLog (@ "buttonIndex:% s", buttonIndex);
}

Leia mais ...

Criar modal MovieClip TopMost

di Flash. Ilustrar uma técnica para criar símbolos componentes (MovieClip) modais a serem utilizados de forma semelhante ao Alert e Window do Flash. O objetivo é mostrar um MovieClip acima de todas as outras, a desactivação - bem - o acesso ao subjacente e qualquer objeto presente / outro componente. Para ser honesto eu ter conseguido que, fazendo um pouco de "engenharia reversa do código da Adobe, que está em claro! Eu realmente têm resistido ;)

O artefizio que é utilizado para desactivar qualquer interface presente abaixo do nosso MovieClip, é o de criar um MovieClip transparente que leva toda a área da fase. a false . Neste MovieClip, que não será muito visível, encaixar um método de "vazio" no evento onRelease , tendo o cuidado de definir o useHandCursor para false .

Primeiro vamos criar um filme com qualquer interface no palco principal:

Interface

Leia mais ...


Pare SOPA