[英]How to change the title background color of the dialog?
最近,我將其用於實現,因此這是我的代碼。
您可以通過在styles.xml文件中創建新樣式來實現:
<style name="question_dialog" parent="@android:style/Theme.Holo.Dialog">
<item name="android:windowTitleStyle">@style/question_dialog_title</item>
</style>
<style name="question_dialog_title" parent="android:Widget.TextView">
<item name="android:background">#5cc5cc</item>
<item name="android:textSize">21sp</item>
<item name="android:textColor">#ffffff</item>
</style>
然后,當您創建Dialog對象時,您想使用以下構造函數:
answeringDialog = new Dialog(this, R.style.question_dialog);
輸出為:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.