2011-04-15 57 views

回答

1

創建一個擴展Dialog的類,然後調用requestWindowFeature而不用標題。

public class CustomizeDialog extends Dialog 
{ 
    public CustomizeDialog(Context context) 
    { 
     super(context); 
     /** It will hide the title */ 
     requestWindowFeature(Window.FEATURE_NO_TITLE); 
     setContentView(R.layout.popup); 

然後你就可以創建你彈出XML

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" android:padding="10dip" android:layout_width="fill_parent" 
    android:layout_height="wrap_content" > 

    <ImageButton android:layout_width="wrap_content" 
     android:id="@+id/YOUR_ID" 
     android:layout_height="wrap_content" android:text="Close" 
     android:src="@drawable/YOUR_DRAWABLE" 
      android:background="@null" /> 

然後你就可以從Java

虛增您彈出
CustomizeDialog customizeDialog = new CustomizeDialog(YOUR_CONTEXT); 
customizeDialog.show(); 
+0

我會試試看。謝謝 – madcoderz 2011-04-15 09:12:18

+0

什麼是'this.instamapMedia = instamapMedia;'在做什麼? – 2011-09-01 21:22:35

+0

這是我的自定義代碼,對不起,我刪除了上面的那一行 – 2011-09-04 20:04:32

相關問題