2017-07-20 13 views
0

我試圖設計日期選擇器對話框的樣式。到目前爲止,我設法改變背​​景和按鈕顏色。但正如你在下面的圖片中看到的那樣,標題有點「柱形」。Android的日期選擇器對話框標題西班牙語版

我與黑框日期選擇器對話框左邊和標題的右側:

我的XML代碼到目前爲止(價值觀/ styles.xml)

<style name="PickerDialogTheme_dark" parent="Theme.AppCompat.Dialog"> 
    <item name="android:background">@color/colorBackground_bgreen</item> 
    <item name="android:buttonBarButtonStyle">@style/ButtonColor</item> 
</style> 

<style name="ButtonColor"> 
    <item name="android:background">@color/colorBackground_bgreen</item> 
</style> 

在java中它是隻是一個普通的日期選擇器對話框構造函數,主題設置爲PickerDialogTheme_dark,並且我試圖讓這個版本適用於Lollipop版本。

所以,希望你們知道如何擺脫這個支柱式的標題。如果可能,不使用碎片,所有在xml將是有利的:)

回答

0

修復它終於在互聯網上搜索更多後!

如何我最後的XML代碼現在看起來:

<style name="PickerDialogTheme_dark" parent="Theme.AppCompat.Dialog"> 
    <item name="android:gravity">center</item> 
    <item name="android:windowBackground">@android:color/transparent</item> 
    <item name="android:alertDialogStyle">@style/DialogBackground_dark</item> 
    <item name="android:windowMinWidthMajor">@android:dimen/dialog_min_width_major</item> 
    <item name="android:windowMinWidthMinor">@android:dimen/dialog_min_width_minor</item> 
</style> 

<style name="DialogBackground_dark"> 
    <item name="android:topDark">@color/colorAccent_bgreen</item> 
    <item name="android:centerDark">@color/colorAccent_bgreen</item> 
    <item name="android:bottomDark">@color/colorAccent_bgreen</item> 
    <item name="android:bottomMedium">@color/colorAccent_bgreen</item> 
</style> 

This is how it looks like now