嗨我想爲我的android應用程序製作一個自定義對話框,並且想用按鈕,複選框和類似項目來填充它。 我遵循了android開發者網站的教程,但那不是我想要的,實際上我想自定義對話框的背景和大小。 如果任何機構可以給我一個首發,另外我想知道什麼時候我爲那個盒子設計背景,我使用什麼尺寸和像素數字,以便它可以在Galaxy Note,Galaxy S和平板電腦等中運行相同手機運行android。 這是自定義對話框的圖片。就像那樣我想制定一些東西。 Android Custom Dialogue Box
1
A
回答
2
是的,這是一個很好的問題。您必須使用自定義對話框,透明BG主題這樣的:
Dialog dialog = new Dialog(mContext, android.R.style.Theme_Translucent_NoTitleBar);
dialog.setContentView(R.layout.custom_dialog);
dialog.show();
其中custom_dialog
將是您的對話框佈局XML,並儘可能維度去,你真的應該測試在許多不同的屏幕您的應用分辨率的設備,以確保它顯示你想要的。
0
有時我想創建一個完全自定義的對話框,例如您所展示的對話框。
當我必須這樣做時,我爭取了一段時間,試圖讓它成爲一個對話框。最後,我發現將自己的對話框包裝在自己的活動中,將其設置爲清單中的透明主題,然後製作佈局xml文件,使邊緣周圍具有透明空間變得容易得多。這是我擺脫所有默認對話框格式的最簡單的方法(即,如果使用setContentView()路由進入它的框架)
因此,雖然它在技術上不是對話框對用戶來說,它具有相同的目的。
相關問題
- 1. fb:like-box,custom css?
- 2. wordpress meta box \ custom fields validation
- 3. Android Custom MapView
- 4. TimePicker Android Custom Hour
- 5. Android Custom CursorAdapter setVisibility
- 6. Android-Show Custom Dialog
- 7. Alert Dialogue dismiss happing
- 8. Android Custom Spinner各色
- 9. Android Custom QuoteSpan問題
- 10. Custom custom permalink for custom post type
- 11. Custom Visibility Converter - Android - Release(MvvmCross)
- 12. Android Custom GridLayout with Text + Image
- 13. Android Custom Galary View not scroll
- 14. Open In Dialogue中BlocksKit崩潰
- 15. $ .dialogue()動態調整大小
- 16. Custom Microdata and Custom Schema.org
- 17. Android Dialogue片段在鍵盤不可見時不會移動
- 18. 如何從android中的main-activity減少alert-dialogue代碼?
- 19. Android Alert Dialogue中使用了什麼字體?
- 20. Doxygen with custom annotations
- 21. 錯誤:Android BOX集成
- 22. custom uitableviewcell
- 23. Custom CollectionViewCell
- 24. custom searchResultsTableView
- 25. Custom ConcurrentSessionControlStrategy
- 26. custom datagridview
- 27. Custom EntityNotFoundDelegate
- 28. Custom Cartridge
- 29. Custom CGAffineTransformationMake
- 30. Custom DependencyProperty
謝謝Marci,讓我來研究一下。我希望它能解決問題。 – Rookie