0
A
回答
1
是的你不能。爲此,您需要創建一個Custom Alert dialog,使其中的圖像視圖膨脹並在點擊所需對象時調用它。您還需要通過在AlertDialog中添加close button來關閉它來設置一個onlick監聽器。
0
是的,你可以使用這樣的事情:
Dialog confirmDeleteDialog = new Dialog(this);
confirmDeleteDialog.setContentView(R.layout.custom_message_dialog);
//This allows dialog to be closed with back button
confirmDeleteDialog.setCancelable(true);
//DisplayMetrics will get the screen dimensions and allow you to
//declare a center point
DiaplayMetrics displaymetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
int screenHeight = displaymetrics.heightPixels; //Divide by 2 to get mid
int screenWidth = displaymetrics.widthPixels; //Divide by 2 to get mid
Button closeButton = (Button) confirmDeleteDialog.findViewById(R.id.close_button);
closeButton.setOnClickListener(this);
confirmDeleteDialog.show();
custom_message_dialog.xml - 可能是這個樣子:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Button
android:id="@+id/close_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"/>
</RelativeLayout>
的ClickListener
public void onClick(View v) {
if(v == closeButton){
confirmDeleteDialog.dismiss();
}}
相關問題
- 1. 關閉域的最後一個選項卡時彈出顯示
- 2. 顯示一個孩子虛擬機,然後顯示另一個,第一個被關閉後
- 3. 顯示第二彈出當我關閉第一個彈出
- 4. 關閉視圖,然後顯示另一個?
- 5. HTML顯示圖像,然後等待,然後顯示另一個圖像
- 6. 如何在使用Javascript單擊另一個時顯示多個隨機圖像?
- 7. 當另一個圖像被點擊時顯示圖像
- 8. C#隨機顯示圖像和一個接一個
- 9. 按鈕點擊後關閉彈出框
- 10. 顯示一個彈出對話框或點擊一個小部件時的自定義彈出視圖
- 11. 通過單擊下一個關閉上一個彈出框
- 12. 關閉彈出窗口,如果我點擊另一個DIV
- 13. 顯示一個圖像,然後另一個使用HTML
- 14. 關閉OnClickListener然後點擊
- 15. 當用戶點擊一個鏈接時顯示一個模式彈出框jqgrid
- 16. 當點擊一個uibutton時關閉popover
- 17. 單擊圖像瀏覽彈出一個視圖顯示原始圖像
- 18. 檢查顯示(隨機)圖像是一樣的最後一個(隨機),圖像(jQuery和JavaScript的)
- 19. Postgres group by,然後顯示該組中的一個隨機
- 20. 如何顯示一個圖像五秒鐘然後顯示另一個(Android Studio)
- 21. 如何用按鈕做一個彈出視圖,然後顯示一個tableView(以彈出式格式)?
- 22. 點擊下一個按鈕時顯示圖像
- 23. Theme.Translucent然後單擊後顯示圖像
- 24. 腳本顯示一個彈出窗口,然後殺死一個Windows進程
- 25. 僅在上一個彈出窗口關閉時纔會顯示多個JavaScript超時彈出窗口
- 26. Android單擊時突出顯示一個圖像按鈕
- 27. 顯示多個圖像隨機
- 28. 辭退彈出當點擊一個圖像
- 29. 顯示一個彈出菜單,當我點擊一個按鈕在oracle形式
- 30. 當點擊一個鏈接時彈出一個gridview
是的,這是可能的。爲了獲得進一步的幫助,您需要找到更具體的問題。 – Shaded 2012-04-11 15:15:56