Bonjour,
J'ai crée une boite de dialogue mais lorsque je lance la boite de dialogue rien apparait seulement un rectangle blanc avec un trait bleu tous en bas .
Ma boite de dialogue
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 public class MainActivity extends ListActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); getListView().setOnItemClickListener(SupModifOnItemClick); } private ListView.OnItemClickListener SupModifOnItemClick = new AdapterView.OnItemClickListener() { public void onItemClick(AdapterView<?> a, View v, int position, long id) { Item t = (Item) a.getItemAtPosition(position); FragmentManager manager = getFragmentManager(); Dial d = new Dial(t); d.show(manager,"Boite de dialogue"); } }; }
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 public class Dial extends DialogFragment { public View onCreateview(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.boite_de_dialogue,null); return v; } }
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 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceMedium" android:text="Medium Text" android:id="@+id/textView" android:layout_alignParentTop="true" android:layout_alignParentLeft="true"/> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Modifier" android:id="@+id/modifier" android:layout_alignParentLeft="@+id/textView" android:layout_below="@id/textView"/> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Supprimer" android:id="@+id/supprimer" android:layout_below="@id/textView" android:layout_toRightOf="@+id/modifier"/> </RelativeLayout>
Partager