2011-10-27 260 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

非常棒的男士,感谢您节省时间的快速反应。 –