我需要有一個自定義AlertDialog與切斷角落,請檢查連接的圖像。圖像不是靜態的,而是透明的,我需要用一些顏色填充它。我應該採取什麼方法來構建這樣的佈局?非常感謝你。自定義AlertDialog與切斷角落
回答
創建9修補圖像。然後爲創建這種類型的對話框創建自定義佈局。假設你的對話框佈局dialog_main ... 然後從下面的代碼創建對話框...
final Dialog dialog = new Dialog(SettingActivity.this);
dialog.setContentView(R.layout.dialog_main);
我們需要您的圖像切割邊緣創建transparent 9-Patch
.png image
。使用您想要的圖像背景顏色Alert Dialog
2.現在使用此圖像爲您的對話框創建一個custom layout
。
現在,在您Custom Alert Dialog.
4.使用自定義佈局現在,作爲Brajendra
說,使用此代碼:
Dialog dialog = new Dialog(SettingActivity.this);
dialog.setContentView(R.layout.dialog_main);
這裏dialog_main
是您可以通過自己的形象創造的佈局切邊。
你能否澄清如何防止這些切角填充?如果我爲圖像設置背景 - 圖像的專用區域將被填充,而不是我定義的唯一'src'。 – Eugene 2013-05-13 13:27:28
在你的圖像只是使這些角落透明,並保存這個圖像的.png格式與透明度。現在使用這個圖像作爲背景,你會自動擁有透明的角落,就像你想要的。是的,角落會填滿圖像,但圖像的這一部分將是透明的,所以它會看起來像你想要的樣子:) – 2013-05-14 04:10:32
- 1. AlertDialog setMessage切斷
- 2. 自定義AlertDialog與它
- 3. 與ListView自定義AlertDialog
- 4. 自定義AlertDialog
- 5. 自定義從AlertDialog
- 6. DialogFragment:使用AlertDialog與自定義佈局
- 7. 多選AlertDialog與自定義適配器
- 8. 的Android AlertDialog與自定義寬度
- 9. Android的圓形圖像與自定義的角落
- 10. 自定義的TextView切斷使用WRAP_CONTENT
- 11. 安卓:自定義AlertDialog
- 12. 自定義alertdialog android api 10
- 13. 在AlertDialog中自定義ListView
- 14. AlertDialog的自定義視圖
- 15. 在Android中自定義AlertDialog
- 16. 自定義AlertDialog邊框
- 17. android中的自定義alertDialog
- 18. EditText:SoftKeyboard在自定義AlertDialog
- 19. 查看背景切斷角落和邊境
- 20. 切斷角落jquery手機可摺疊套裝
- 21. Android:具有自定義視圖和圓角的AlertDialog
- 22. 自定義IQueryProvider回落LinqToObjects
- 23. Umbraco自定義url段落
- 24. 的Android AlertDialog圓角:矩形看到下面的角落
- 25. ATRB在Frustum由8個角落定義
- 26. 定義自定義角色
- 27. 使用自定義小部件的圓形圖像角落
- 28. 剪裁自定義的UITableViewCells組圓角落
- 29. 使用CSS創建自定義邊框,只顯示角落
- 30. 自定義UIButton圓形角落變得高亮?
你需要採取的圖像,並將其設置爲背景資源,'AlertDialog' – Pragnani 2013-05-13 12:48:45
我需要填寫與自定義顏色這個黑色區域的膨脹的觀點,我怎麼能填滿保持角落的人呢。 – Eugene 2013-05-13 12:52:04