2011-10-27 160 views
3

我想創建一個像google文檔應用程序一樣的android honeycomb彈出窗口我跟着this教程,我能夠彈出窗口,但是如何使它成爲模態窗口?如何創建像在圖像顯示如何在android中創建彈出窗口模式窗口

Screen shot of popup window

+0

那必須是[AlertDialog](http://developer.android.com/guide/topics/ui/dialogs.html#AlertDialog)風味之一? – slkorolev

回答

8

試試這一個邊界效應。

Dialog d = new AlertDialog.Builder(Buddies.this,AlertDialog.THEME_HOLO_LIGHT) 
        .setTitle("Create New") 
        .setNegativeButton("Cancel", null) 
        .setItems(new String[]{"Document", "SpreadSheet","",""}, new DialogInterface.OnClickListener(){ 
         @Override 
         public void onClick(DialogInterface dlg, int position) 
         { 
          if (position == 0) 
          { 
          } 
          else if(position == 1){ 

          } 
          else if(position == 2){ 


          } 

         } 
        }) 
        .create(); 
        d.show(); 
+0

非常棒的男士,感謝您節省時間的快速反應。 –