Bonjour,
je viens poster ici car j'ai un petit problème vec mes Dialog.
En effet, dans mon application j'affiche quelques fois des Dialog, et tout fonctionne nickel.
Le problème, c'est que la barre de titre prend trop de place, et ne me sert pas. je l'ai donc enlevé avec le code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
dialogEnigme.requestWindowFeature(Window.FEATURE_NO_TITLE);
Et la la barre de titre disparait, mais mon affichage est complètement modifié.

Voici le résultat avec la barre de titre :

Nom : A1.png
Affichages : 131
Taille : 306,4 Ko
Et celui sans :
Nom : A2.png
Affichages : 113
Taille : 351,9 Ko

Donc si quelqu'un a déjà eut ce problème, j'aimerais bien savoir pourquoi la barre de titre me change l'affichage ?

Voila le code complet :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
@Override
	public Dialog onCreateDialog (int id) {
 
		AlertDialog.Builder builder = new AlertDialog.Builder(this);
		switch(id) {
case ENIGME_DIALOG:
			int idEnigme=2;
			Bdd bdd = new Bdd(PlateauActivity.this);
			bdd.open();
			en = new Enigme();
			en = bdd.getEnigmeWithId(idEnigme);
 
			dialogEnigme=new Dialog(this);
			dialogEnigme.requestWindowFeature(Window.FEATURE_NO_TITLE);
			dialogEnigme.setContentView(R.layout.enigmdialog);
 
			//dialogEnigme.setTitle("Énigme niveau " + Util.niveau);
 
			final TextView question = (TextView) dialogEnigme.findViewById(R.id.question);
			final Button reponse1=(Button)dialogEnigme.findViewById(R.id.prop1);
			final Button reponse2=(Button)dialogEnigme.findViewById(R.id.prop2);
			final Button reponse3=(Button)dialogEnigme.findViewById(R.id.prop3);
			final TextView reponse=(TextView) dialogEnigme.findViewById(R.id.reponse);
			final TextView explication = (TextView) dialogEnigme.findViewById(R.id.explication);
 
			explication.setVisibility(View.INVISIBLE);
			reponse.setVisibility(View.INVISIBLE);
			reponse1.setText(""+en.getReponse1());
			reponse2.setText(""+en.getReponse2());
			reponse3.setText(""+en.getReponse3());
 
			question.setText(""+en.getQuestion());
return dialogenigm;
}